tlsprv.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_TLS_PRV_H_
00012 #define _KLONE_TLS_PRV_H_
00013
00014 #include "klone_conf.h"
00015 #ifdef SSL_ON
00016
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020
00021
00022 struct tls_rand_seed_s
00023 {
00024 pid_t pid;
00025 long t1, t2;
00026 void *stack;
00027 };
00028
00029 typedef struct tls_rand_seed_s tls_rand_seed_t;
00030
00031
00032
00033
00034
00035
00036 struct tls_ctx_args_s
00037 {
00038 const char *cert;
00039 const char *key;
00040 const char *certchain;
00041 const char *ca;
00042 const char *crl;
00043 const char *dh;
00044 #ifdef SSL_OPENSSL_PSK
00045 const char *pskdb;
00046 int psk_is_hashed;
00047 const char *psk_hint;
00048 #endif
00049 int crlopts;
00050 int depth;
00051 int vmode;
00052 };
00053
00054 typedef struct tls_ctx_args_s tls_ctx_args_t;
00055
00056
00057 #ifdef SSL_OPENSSL
00058 DH *get_dh1024 (void);
00059 BIO *bio_from_emb (const char *);
00060 BIO *tls_get_file_bio(const char *res_name);
00061 STACK_OF(X509_NAME) *tls_load_client_CA_file(const char *);
00062 #endif
00063 int tls_load_verify_locations(SSL_CTX *, const char *);
00064 int tls_use_certificate_file(SSL_CTX *, const char *, int);
00065 int tls_use_PrivateKey_file(SSL_CTX *, const char *, int);
00066 int tls_use_certificate_chain(SSL_CTX *, const char *, int,
00067 int (*)(char *, int, int, void *));
00068 int tls_use_crls (SSL_CTX *ctx, tls_ctx_args_t *cargs);
00069 int tls_verify_cb (int ok, X509_STORE_CTX *ctx);
00070 char *tls_get_error (void);
00071 #ifdef SSL_OPENSSL_PSK
00072 int tls_psk_init (SSL_CTX *c, tls_ctx_args_t *cargs);
00073 #endif
00074
00075 #ifdef __cplusplus
00076 }
00077 #endif
00078
00079 #endif
00080 #endif