dup_key without need of canl_ctx
authorMarcel Poul <marcel.poul@cern.ch>
Sun, 15 Apr 2012 23:35:15 +0000 (23:35 +0000)
committerMarcel Poul <marcel.poul@cern.ch>
Sun, 15 Apr 2012 23:35:15 +0000 (23:35 +0000)
emi.canl.canl-c/src/canl_cred.c
emi.canl.canl-c/src/canl_mech_ssl.h

index 8df9bed..4670f24 100644 (file)
@@ -4,7 +4,6 @@
 
 #define DEF_KEY_LEN 1024
 
-static int pkey_dup(glb_ctx *cc, EVP_PKEY **to, EVP_PKEY *from);
 static STACK_OF(X509)* my_sk_X509_dup(glb_ctx *cc, STACK_OF(X509) *stack);
 
 static STACK_OF(X509)* my_sk_X509_dup(glb_ctx *cc, STACK_OF(X509) *stack)
@@ -122,7 +121,7 @@ canl_ctx_set_cred(canl_ctx ctx, canl_cred cred)
     }
 
     if (crd->c_key) {
-        if ((ret = pkey_dup(cc, &m_ctx->cert_key->key, crd->c_key))) {
+        if ((ret = pkey_dup(&m_ctx->cert_key->key, crd->c_key))) {
             return ret;
         }
     }
@@ -134,7 +133,7 @@ canl_ctx_set_cred(canl_ctx ctx, canl_cred cred)
     return 0;
 }
 
-static int pkey_dup(glb_ctx *cc, EVP_PKEY **to, EVP_PKEY *from)
+int pkey_dup(EVP_PKEY **to, EVP_PKEY *from)
 {
     CRYPTO_add(&from->references,1,CRYPTO_LOCK_EVP_PKEY);
     *to = from;
index f9010f3..6b16fa0 100644 (file)
@@ -28,5 +28,6 @@ int do_set_ctx_own_cert_file(glb_ctx *cc, mech_glb_ctx *m_ctx,
 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);
+int pkey_dup(EVP_PKEY **to, EVP_PKEY *from);
 
 #endif