nl_ssl.h File Reference

#include <gwenhywfar/netlayer.h>
#include <gwenhywfar/db.h>
#include <gwenhywfar/ssl_cipher.h>
#include <gwenhywfar/ssl_cert_descr.h>

Include dependency graph for nl_ssl.h:

Go to the source code of this file.

Defines

#define GWEN_NL_SSL_NAME   "SSL"

Typedefs

typedef
GWEN_NL_SSL_ASKADDCERT_RESULT(* 
GWEN_NL_SSL_ASKADDCERT_FN )(GWEN_NETLAYER *nl, const GWEN_SSLCERTDESCR *cert, void *user_data)

Enumerations

enum  GWEN_NL_SSL_ASKADDCERT_RESULT {
  GWEN_NetLayerSsl_AskAddCertResult_Error = 0, GWEN_NetLayerSsl_AskAddCertResult_No, GWEN_NetLayerSsl_AskAddCertResult_Tmp, GWEN_NetLayerSsl_AskAddCertResult_Perm,
  GWEN_NetLayerSsl_AskAddCertResult_Incoming
}

Functions

GWENHYWFAR_API
GWEN_NL_SSL_ASKADDCERT_RESULT 
GWEN_NetLayerSsl_AskAddCert (GWEN_NETLAYER *nl, const GWEN_SSLCERTDESCR *cd)
GWENHYWFAR_API int GWEN_NetLayerSsl_GenerateCertAndKeyFile (const char *fname, int bits, int serial, int days, const GWEN_SSLCERTDESCR *cd)
GWENHYWFAR_API int GWEN_NetLayerSsl_GenerateDhFile (const char *fname, int bits)
GWENHYWFAR_API
GWEN_SSLCIPHER_LIST
GWEN_NetLayerSsl_GetCipherList ()
GWENHYWFAR_API int GWEN_NetLayerSsl_GetIsSecure (const GWEN_NETLAYER *nl)
GWENHYWFAR_API const
GWEN_SSLCERTDESCR
GWEN_NetLayerSsl_GetPeerCertificate (const GWEN_NETLAYER *nl)
GWENHYWFAR_API int GWEN_NetLayerSsl_ImportCertFile (const char *fname, const char *dname, int overwrite)
GWENHYWFAR_API GWEN_NETLAYERGWEN_NetLayerSsl_new (GWEN_NETLAYER *baseLayer, const char *capath, const char *newcapath, const char *ownCertFile, const char *dhFolder, int secure)
GWENHYWFAR_API void GWEN_NetLayerSsl_SetAskAddCertFn (GWEN_NETLAYER *nl, GWEN_NL_SSL_ASKADDCERT_FN fn, void *user_data)
GWENHYWFAR_API void GWEN_NetLayerSsl_SetCiphers (GWEN_NETLAYER *nl, const char *ciphers)


Define Documentation

#define GWEN_NL_SSL_NAME   "SSL"


Typedef Documentation


Enumeration Type Documentation

Enumerator:
GWEN_NetLayerSsl_AskAddCertResult_Error  error asking the user
GWEN_NetLayerSsl_AskAddCertResult_No  user does not trust the given certificate
GWEN_NetLayerSsl_AskAddCertResult_Tmp  user trusts the given certificate for this session only
GWEN_NetLayerSsl_AskAddCertResult_Perm  user trusts the given certificate permanently
GWEN_NetLayerSsl_AskAddCertResult_Incoming  store the cert in an incoming directory, trust it for this session


Function Documentation

GWENHYWFAR_API GWEN_NL_SSL_ASKADDCERT_RESULT GWEN_NetLayerSsl_AskAddCert ( GWEN_NETLAYER nl,
const GWEN_SSLCERTDESCR cd 
)

GWENHYWFAR_API int GWEN_NetLayerSsl_GenerateCertAndKeyFile ( const char *  fname,
int  bits,
int  serial,
int  days,
const GWEN_SSLCERTDESCR cd 
)

GWENHYWFAR_API int GWEN_NetLayerSsl_GenerateDhFile ( const char *  fname,
int  bits 
)

GWENHYWFAR_API GWEN_SSLCIPHER_LIST* GWEN_NetLayerSsl_GetCipherList (  ) 

GWENHYWFAR_API int GWEN_NetLayerSsl_GetIsSecure ( const GWEN_NETLAYER nl  ) 

GWENHYWFAR_API const GWEN_SSLCERTDESCR* GWEN_NetLayerSsl_GetPeerCertificate ( const GWEN_NETLAYER nl  ) 

GWENHYWFAR_API int GWEN_NetLayerSsl_ImportCertFile ( const char *  fname,
const char *  dname,
int  overwrite 
)

This function imports a certificate file and stores it under the correct name in the given folder. The expected format of the cert file is the same as that of certs generated by GWEN_NetLayerSsl_GenerateCertAndKeyFile(). For OpenSSL the destination name of the cert file is the hash of the name part of the given cert. However, the caller should not care about the destination name or the format of the destination file.

GWENHYWFAR_API GWEN_NETLAYER* GWEN_NetLayerSsl_new ( GWEN_NETLAYER baseLayer,
const char *  capath,
const char *  newcapath,
const char *  ownCertFile,
const char *  dhFolder,
int  secure 
)

GWENHYWFAR_API void GWEN_NetLayerSsl_SetAskAddCertFn ( GWEN_NETLAYER nl,
GWEN_NL_SSL_ASKADDCERT_FN  fn,
void *  user_data 
)

GWENHYWFAR_API void GWEN_NetLayerSsl_SetCiphers ( GWEN_NETLAYER nl,
const char *  ciphers 
)


doxygen