diff options
author | Nils Larsch <nils@openssl.org> | 2005-04-09 00:52:42 +0200 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-04-09 00:52:42 +0200 |
commit | dc0ed30cfeb37d64fc2bd26887b19e0898a96bde (patch) | |
tree | 9f0a4b1fdc3bebf3a0fc0e08d7ff769d7c3533b2 /ssl | |
parent | improve docu of SSL_CTX_use_PrivateKey() (diff) | |
download | openssl-dc0ed30cfeb37d64fc2bd26887b19e0898a96bde.tar.xz openssl-dc0ed30cfeb37d64fc2bd26887b19e0898a96bde.zip |
add support for DER encoded private keys to SSL_CTX_use_PrivateKey_file()
and SSL_use_PrivateKey_file()
PR: 1035
Submitted by: Walter Goulet
Reviewed by: Nils Larsch
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_rsa.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index f639d9a08f..fc42dfa1ec 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -335,6 +335,11 @@ int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) pkey=PEM_read_bio_PrivateKey(in,NULL, ssl->ctx->default_passwd_callback,ssl->ctx->default_passwd_callback_userdata); } + else if (type == SSL_FILETYPE_ASN1) + { + j = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in,NULL); + } else { SSLerr(SSL_F_SSL_USE_PRIVATEKEY_FILE,SSL_R_BAD_SSL_FILETYPE); @@ -649,6 +654,11 @@ int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) pkey=PEM_read_bio_PrivateKey(in,NULL, ctx->default_passwd_callback,ctx->default_passwd_callback_userdata); } + else if (type == SSL_FILETYPE_ASN1) + { + j = ERR_R_ASN1_LIB; + pkey = d2i_PrivateKey_bio(in,NULL); + } else { SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE,SSL_R_BAD_SSL_FILETYPE); |