diff options
author | steve <steve> | 2008-06-01 22:33:23 +0000 |
---|---|---|
committer | steve <steve> | 2008-06-01 22:33:23 +0000 |
commit | d1375a84c81a548ea6a8c11058ee02cca441514c (patch) | |
tree | e7375a037c73acdfcef4c4e84d37e56c4c3d8889 /ssl/ssl_sess.c | |
parent | bd39249534f349c547ee0b4286721cb8b0a275b8 (diff) | |
download | openssl-d1375a84c81a548ea6a8c11058ee02cca441514c.tar.gz |
Add client cert engine to SSL routines.
Diffstat (limited to 'ssl/ssl_sess.c')
-rw-r--r-- | ssl/ssl_sess.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c index 33d302aa4..12cc486b1 100644 --- a/ssl/ssl_sess.c +++ b/ssl/ssl_sess.c @@ -138,6 +138,9 @@ #include <stdio.h> #include <openssl/lhash.h> #include <openssl/rand.h> +#ifndef OPENSSL_NO_ENGINE +#include <openssl/engine.h> +#endif #include "ssl_locl.h" static void SSL_SESSION_list_remove(SSL_CTX *ctx, SSL_SESSION *s); @@ -998,6 +1001,25 @@ int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL * ssl, X509 ** x509 , EVP_PK return ctx->client_cert_cb; } +#ifndef OPENSSL_NO_ENGINE +int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e) + { + if (!ENGINE_init(e)) + { + SSLerr(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE, ERR_R_ENGINE_LIB); + return 0; + } + if(!ENGINE_get_ssl_client_cert_function(e)) + { + SSLerr(SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE, SSL_R_NO_CLIENT_CERT_METHOD); + ENGINE_finish(e); + return 0; + } + ctx->client_cert_engine = e; + return 1; + } +#endif + void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, unsigned char *cookie, unsigned int *cookie_len)) { |