diff options
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_depr.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_depr.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_depr.c b/src/lib/libcrypto/dsa/dsa_depr.c index 8e3125b66f..50169ac9b2 100644 --- a/src/lib/libcrypto/dsa/dsa_depr.c +++ b/src/lib/libcrypto/dsa/dsa_depr.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dsa_depr.c,v 1.3 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: dsa_depr.c,v 1.4 2014/07/09 10:16:24 miod Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -56,19 +56,6 @@ | |||
| 56 | /* This file contains deprecated function(s) that are now wrappers to the new | 56 | /* This file contains deprecated function(s) that are now wrappers to the new |
| 57 | * version(s). */ | 57 | * version(s). */ |
| 58 | 58 | ||
| 59 | #undef GENUINE_DSA | ||
| 60 | |||
| 61 | #ifdef GENUINE_DSA | ||
| 62 | /* Parameter generation follows the original release of FIPS PUB 186, | ||
| 63 | * Appendix 2.2 (i.e. use SHA as defined in FIPS PUB 180) */ | ||
| 64 | #define HASH EVP_sha() | ||
| 65 | #else | ||
| 66 | /* Parameter generation follows the updated Appendix 2.2 for FIPS PUB 186, | ||
| 67 | * also Appendix 2.2 of FIPS PUB 186-1 (i.e. use SHA as defined in | ||
| 68 | * FIPS PUB 180-1) */ | ||
| 69 | #define HASH EVP_sha1() | ||
| 70 | #endif | ||
| 71 | |||
| 72 | #ifndef OPENSSL_NO_SHA | 59 | #ifndef OPENSSL_NO_SHA |
| 73 | 60 | ||
| 74 | #include <stdio.h> | 61 | #include <stdio.h> |
| @@ -81,24 +68,24 @@ | |||
| 81 | #include <openssl/sha.h> | 68 | #include <openssl/sha.h> |
| 82 | 69 | ||
| 83 | #ifndef OPENSSL_NO_DEPRECATED | 70 | #ifndef OPENSSL_NO_DEPRECATED |
| 84 | DSA *DSA_generate_parameters(int bits, | 71 | DSA * |
| 85 | unsigned char *seed_in, int seed_len, | 72 | DSA_generate_parameters(int bits, unsigned char *seed_in, int seed_len, |
| 86 | int *counter_ret, unsigned long *h_ret, | 73 | int *counter_ret, unsigned long *h_ret, void (*callback)(int, int, void *), |
| 87 | void (*callback)(int, int, void *), | 74 | void *cb_arg) |
| 88 | void *cb_arg) | 75 | { |
| 89 | { | ||
| 90 | BN_GENCB cb; | 76 | BN_GENCB cb; |
| 91 | DSA *ret; | 77 | DSA *ret; |
| 92 | 78 | ||
| 93 | if ((ret=DSA_new()) == NULL) return NULL; | 79 | if ((ret = DSA_new()) == NULL) |
| 80 | return NULL; | ||
| 94 | 81 | ||
| 95 | BN_GENCB_set_old(&cb, callback, cb_arg); | 82 | BN_GENCB_set_old(&cb, callback, cb_arg); |
| 96 | 83 | ||
| 97 | if(DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, | 84 | if (DSA_generate_parameters_ex(ret, bits, seed_in, seed_len, |
| 98 | counter_ret, h_ret, &cb)) | 85 | counter_ret, h_ret, &cb)) |
| 99 | return ret; | 86 | return ret; |
| 100 | DSA_free(ret); | 87 | DSA_free(ret); |
| 101 | return NULL; | 88 | return NULL; |
| 102 | } | 89 | } |
| 103 | #endif | 90 | #endif |
| 104 | #endif | 91 | #endif |
