diff options
| author | tedu <> | 2014-04-17 21:37:37 +0000 |
|---|---|---|
| committer | tedu <> | 2014-04-17 21:37:37 +0000 |
| commit | ce6ab96382363d98326902c9baeb3f23ffd2794c (patch) | |
| tree | 08e9b3a8cf6f35c7585646ca19c69f2ba87cc08c /src/lib/libssl/ssl_rsa.c | |
| parent | 2ca67c675bf3d9334c53074965440cb3de9df1d3 (diff) | |
| download | openbsd-ce6ab96382363d98326902c9baeb3f23ffd2794c.tar.gz openbsd-ce6ab96382363d98326902c9baeb3f23ffd2794c.tar.bz2 openbsd-ce6ab96382363d98326902c9baeb3f23ffd2794c.zip | |
always build in RSA and DSA. ok deraadt miod
Diffstat (limited to 'src/lib/libssl/ssl_rsa.c')
| -rw-r--r-- | src/lib/libssl/ssl_rsa.c | 10 |
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 | ||
| 146 | int | 145 | int |
| 147 | SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) | 146 | SSL_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 | ||
| 174 | static int | 172 | static int |
| 175 | ssl_set_pkey(CERT *c, EVP_PKEY *pkey) | 173 | ssl_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 |
| 219 | int | 214 | int |
| 220 | SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) | 215 | SSL_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 | ||
| 279 | int | 273 | int |
| 280 | SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) | 274 | SSL_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 | ||
| 489 | int | 480 | int |
| 490 | SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) | 481 | SSL_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 | ||
| 577 | int | 567 | int |
| 578 | SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) | 568 | SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) |
