From fb7bbe160aabeec884a1c4250e4735d1c5af5505 Mon Sep 17 00:00:00 2001 From: Marcel Poul Date: Wed, 29 Feb 2012 01:51:04 +0000 Subject: [PATCH] make use of canl_mech_ssl to include openssl header files --- emi.canl.canl-c/Makefile | 2 +- emi.canl.canl-c/src/canl_cert.c | 1 + emi.canl.canl-c/src/canl_cred.c | 1 + emi.canl.canl-c/src/canl_locl.h | 29 +---------------------------- emi.canl.canl-c/src/canl_mech_ssl.h | 4 ++++ emi.canl.canl-c/src/canl_ssl.c | 1 + emi.canl.canl-c/src/gen_err_desc.pl | 1 + 7 files changed, 10 insertions(+), 29 deletions(-) diff --git a/emi.canl.canl-c/Makefile b/emi.canl.canl-c/Makefile index 9189773..54a7bb4 100644 --- a/emi.canl.canl-c/Makefile +++ b/emi.canl.canl-c/Makefile @@ -31,7 +31,7 @@ LFLAGS_SER=-L. -lcanl_c CFLAGS_PRX=-Wall -g -I${top_srcdir}/src -I. LFLAGS_PRX=-L. -lcanl_c -HEAD_CANL=canl.h canl_locl.h canl_err.h canl_cred.h canl_ssl.h +HEAD_CANL=canl.h canl_locl.h canl_err.h canl_cred.h canl_ssl.h canl_mech_ssl.h SRC_CLI=canl_sample_client.c HEAD_CLI=canl.h diff --git a/emi.canl.canl-c/src/canl_cert.c b/emi.canl.canl-c/src/canl_cert.c index e71b2ce..4ff6f1a 100644 --- a/emi.canl.canl-c/src/canl_cert.c +++ b/emi.canl.canl-c/src/canl_cert.c @@ -1,4 +1,5 @@ #include "canl_locl.h" +#include "canl_mech_ssl.h" #if 0 static int set_cert(glb_ctx *cc, X509 *cert); diff --git a/emi.canl.canl-c/src/canl_cred.c b/emi.canl.canl-c/src/canl_cred.c index 06d1ddb..082fe9c 100644 --- a/emi.canl.canl-c/src/canl_cred.c +++ b/emi.canl.canl-c/src/canl_cred.c @@ -1,5 +1,6 @@ #include "canl_locl.h" #include "canl_cred.h" +#include "canl_mech_ssl.h" static int pkey_dup(glb_ctx *cc, EVP_PKEY **to, EVP_PKEY *from); diff --git a/emi.canl.canl-c/src/canl_locl.h b/emi.canl.canl-c/src/canl_locl.h index b57422f..b1e2401 100644 --- a/emi.canl.canl-c/src/canl_locl.h +++ b/emi.canl.canl-c/src/canl_locl.h @@ -7,12 +7,6 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include @@ -127,29 +121,8 @@ typedef struct canl_mech { } canl_mech; -/* Openssl specific**************************/ -typedef struct _cert_key_store { - X509 *cert; - EVP_PKEY *key; - STACK_OF(X509) *chain; -} cert_key_store; - -typedef struct _mech_glb_ctx -{ - void *mech_ctx; //like SSL_CTX * - unsigned int flags; - char *ca_dir; - char *crl_dir; - cert_key_store *cert_key; -} mech_glb_ctx; - -int do_set_ctx_own_cert_file(glb_ctx *cc, mech_glb_ctx *m_ctx, - char *cert, char *key); -int set_key_file(glb_ctx *cc, EVP_PKEY **to, const char *key); -int set_cert_file(glb_ctx *cc, X509 **to, const char *cert); -int set_cert_chain_file(glb_ctx *cc, STACK_OF(X509) **to, const char *cert); +/* Mechanism specific */ extern canl_mech canl_mech_ssl; -/* *****************************************/ struct canl_mech * find_mech(gss_OID oid); diff --git a/emi.canl.canl-c/src/canl_mech_ssl.h b/emi.canl.canl-c/src/canl_mech_ssl.h index f7b524d..e55e31b 100644 --- a/emi.canl.canl-c/src/canl_mech_ssl.h +++ b/emi.canl.canl-c/src/canl_mech_ssl.h @@ -1,8 +1,12 @@ #ifndef _CANL_MECH_SSL_H #define _CANL_MECH_SSL_H +#include #include +#include #include +#include +#include typedef struct _cert_key_store { X509 *cert; diff --git a/emi.canl.canl-c/src/canl_ssl.c b/emi.canl.canl-c/src/canl_ssl.c index 4beb0a4..6b4321f 100644 --- a/emi.canl.canl-c/src/canl_ssl.c +++ b/emi.canl.canl-c/src/canl_ssl.c @@ -1,5 +1,6 @@ #include "canl_locl.h" #include "canl_ssl.h" +#include "canl_mech_ssl.h" #define SSL_SERVER_METH SSLv23_server_method() #define SSL_CLIENT_METH SSLv3_client_method() diff --git a/emi.canl.canl-c/src/gen_err_desc.pl b/emi.canl.canl-c/src/gen_err_desc.pl index 3aca980..c17c3a2 100755 --- a/emi.canl.canl-c/src/gen_err_desc.pl +++ b/emi.canl.canl-c/src/gen_err_desc.pl @@ -31,6 +31,7 @@ print qq (/* */ #include "canl_locl.h" +#include "canl_mech_ssl.h" struct canl_err_desc canl_err_descs[] = {); -- 1.8.2.3