diff options
Diffstat (limited to 'src/lib/libcrypto/engine/eng_pkey.c')
-rw-r--r-- | src/lib/libcrypto/engine/eng_pkey.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/lib/libcrypto/engine/eng_pkey.c b/src/lib/libcrypto/engine/eng_pkey.c index bc8b21abec..1dfa2e3664 100644 --- a/src/lib/libcrypto/engine/eng_pkey.c +++ b/src/lib/libcrypto/engine/eng_pkey.c | |||
@@ -69,6 +69,13 @@ int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f) | |||
69 | return 1; | 69 | return 1; |
70 | } | 70 | } |
71 | 71 | ||
72 | int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, | ||
73 | ENGINE_SSL_CLIENT_CERT_PTR loadssl_f) | ||
74 | { | ||
75 | e->load_ssl_client_cert = loadssl_f; | ||
76 | return 1; | ||
77 | } | ||
78 | |||
72 | ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e) | 79 | ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e) |
73 | { | 80 | { |
74 | return e->load_privkey; | 81 | return e->load_privkey; |
@@ -79,6 +86,11 @@ ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e) | |||
79 | return e->load_pubkey; | 86 | return e->load_pubkey; |
80 | } | 87 | } |
81 | 88 | ||
89 | ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e) | ||
90 | { | ||
91 | return e->load_ssl_client_cert; | ||
92 | } | ||
93 | |||
82 | /* API functions to load public/private keys */ | 94 | /* API functions to load public/private keys */ |
83 | 95 | ||
84 | EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, | 96 | EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, |
@@ -152,3 +164,33 @@ EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, | |||
152 | } | 164 | } |
153 | return pkey; | 165 | return pkey; |
154 | } | 166 | } |
167 | |||
168 | int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, | ||
169 | STACK_OF(X509_NAME) *ca_dn, X509 **pcert, EVP_PKEY **ppkey, | ||
170 | STACK_OF(X509) **pother, UI_METHOD *ui_method, void *callback_data) | ||
171 | { | ||
172 | |||
173 | if(e == NULL) | ||
174 | { | ||
175 | ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, | ||
176 | ERR_R_PASSED_NULL_PARAMETER); | ||
177 | return 0; | ||
178 | } | ||
179 | CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); | ||
180 | if(e->funct_ref == 0) | ||
181 | { | ||
182 | CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); | ||
183 | ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, | ||
184 | ENGINE_R_NOT_INITIALISED); | ||
185 | return 0; | ||
186 | } | ||
187 | CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); | ||
188 | if (!e->load_ssl_client_cert) | ||
189 | { | ||
190 | ENGINEerr(ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT, | ||
191 | ENGINE_R_NO_LOAD_FUNCTION); | ||
192 | return 0; | ||
193 | } | ||
194 | return e->load_ssl_client_cert(e, s, ca_dn, pcert, ppkey, pother, | ||
195 | ui_method, callback_data); | ||
196 | } | ||