summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/ssl_rsa.c')
-rw-r--r--src/lib/libssl/ssl_rsa.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c
index 078df55f06..05d18de1d9 100644
--- a/src/lib/libssl/ssl_rsa.c
+++ b/src/lib/libssl/ssl_rsa.c
@@ -142,7 +142,6 @@ SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len)
142 return (ret); 142 return (ret);
143} 143}
144 144
145#ifndef OPENSSL_NO_RSA
146int 145int
147SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) 146SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
148{ 147{
@@ -169,7 +168,6 @@ SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
169 EVP_PKEY_free(pkey); 168 EVP_PKEY_free(pkey);
170 return (ret); 169 return (ret);
171} 170}
172#endif
173 171
174static int 172static int
175ssl_set_pkey(CERT *c, EVP_PKEY *pkey) 173ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
@@ -189,14 +187,12 @@ ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
189 EVP_PKEY_free(pktmp); 187 EVP_PKEY_free(pktmp);
190 ERR_clear_error(); 188 ERR_clear_error();
191 189
192#ifndef OPENSSL_NO_RSA
193 /* Don't check the public/private key, this is mostly 190 /* Don't check the public/private key, this is mostly
194 * for smart cards. */ 191 * for smart cards. */
195 if ((pkey->type == EVP_PKEY_RSA) && 192 if ((pkey->type == EVP_PKEY_RSA) &&
196 (RSA_flags(pkey->pkey.rsa) & RSA_METHOD_FLAG_NO_CHECK)) 193 (RSA_flags(pkey->pkey.rsa) & RSA_METHOD_FLAG_NO_CHECK))
197; 194;
198 else 195 else
199#endif
200 if (!X509_check_private_key(c->pkeys[i].x509, pkey)) { 196 if (!X509_check_private_key(c->pkeys[i].x509, pkey)) {
201 X509_free(c->pkeys[i].x509); 197 X509_free(c->pkeys[i].x509);
202 c->pkeys[i].x509 = NULL; 198 c->pkeys[i].x509 = NULL;
@@ -214,7 +210,6 @@ ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
214 return (1); 210 return (1);
215} 211}
216 212
217#ifndef OPENSSL_NO_RSA
218#ifndef OPENSSL_NO_STDIO 213#ifndef OPENSSL_NO_STDIO
219int 214int
220SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) 215SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type)
@@ -274,7 +269,6 @@ SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len)
274 RSA_free(rsa); 269 RSA_free(rsa);
275 return (ret); 270 return (ret);
276} 271}
277#endif /* !OPENSSL_NO_RSA */
278 272
279int 273int
280SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) 274SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey)
@@ -390,7 +384,6 @@ ssl_set_cert(CERT *c, X509 *x)
390 EVP_PKEY_copy_parameters(pkey, c->pkeys[i].privatekey); 384 EVP_PKEY_copy_parameters(pkey, c->pkeys[i].privatekey);
391 ERR_clear_error(); 385 ERR_clear_error();
392 386
393#ifndef OPENSSL_NO_RSA
394 /* Don't check the public/private key, this is mostly 387 /* Don't check the public/private key, this is mostly
395 * for smart cards. */ 388 * for smart cards. */
396 if ((c->pkeys[i].privatekey->type == EVP_PKEY_RSA) && 389 if ((c->pkeys[i].privatekey->type == EVP_PKEY_RSA) &&
@@ -398,7 +391,6 @@ ssl_set_cert(CERT *c, X509 *x)
398 RSA_METHOD_FLAG_NO_CHECK)) 391 RSA_METHOD_FLAG_NO_CHECK))
399; 392;
400 else 393 else
401#endif /* OPENSSL_NO_RSA */
402 if (!X509_check_private_key(x, c->pkeys[i].privatekey)) { 394 if (!X509_check_private_key(x, c->pkeys[i].privatekey)) {
403 /* don't fail for a cert/key mismatch, just free 395 /* don't fail for a cert/key mismatch, just free
404 * current private key (when switching to a different 396 * current private key (when switching to a different
@@ -485,7 +477,6 @@ SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d)
485 return (ret); 477 return (ret);
486} 478}
487 479
488#ifndef OPENSSL_NO_RSA
489int 480int
490SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) 481SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
491{ 482{
@@ -572,7 +563,6 @@ SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len)
572 RSA_free(rsa); 563 RSA_free(rsa);
573 return (ret); 564 return (ret);
574} 565}
575#endif /* !OPENSSL_NO_RSA */
576 566
577int 567int
578SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) 568SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey)