diff options
| author | djm <> | 2005-04-29 05:37:34 +0000 | 
|---|---|---|
| committer | djm <> | 2005-04-29 05:37:34 +0000 | 
| commit | a95585a25ab25668b931a78b7543f707a3354db8 (patch) | |
| tree | f9e9febf7ac0c8f5d6df761fe70fd613aac06203 /src/lib/libcrypto/dsa/dsa_sign.c | |
| parent | 58c08aa241f168c84ce7cc3052454ea59a44eada (diff) | |
| download | openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.gz openbsd-a95585a25ab25668b931a78b7543f707a3354db8.tar.bz2 openbsd-a95585a25ab25668b931a78b7543f707a3354db8.zip  | |
import of openssl-0.9.7g; tested on platforms from alpha to zaurus, ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_sign.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_sign.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_sign.c b/src/lib/libcrypto/dsa/dsa_sign.c index 89205026f0..3c9753bac3 100644 --- a/src/lib/libcrypto/dsa/dsa_sign.c +++ b/src/lib/libcrypto/dsa/dsa_sign.c  | |||
| @@ -64,9 +64,17 @@ | |||
| 64 | #include <openssl/dsa.h> | 64 | #include <openssl/dsa.h> | 
| 65 | #include <openssl/rand.h> | 65 | #include <openssl/rand.h> | 
| 66 | #include <openssl/asn1.h> | 66 | #include <openssl/asn1.h> | 
| 67 | #ifndef OPENSSL_NO_ENGINE | ||
| 68 | #include <openssl/engine.h> | ||
| 69 | #endif | ||
| 70 | #include <openssl/fips.h> | ||
| 67 | 71 | ||
| 68 | DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | 72 | DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) | 
| 69 | { | 73 | { | 
| 74 | #ifdef OPENSSL_FIPS | ||
| 75 | if(FIPS_mode() && !FIPS_dsa_check(dsa)) | ||
| 76 | return NULL; | ||
| 77 | #endif | ||
| 70 | return dsa->meth->dsa_do_sign(dgst, dlen, dsa); | 78 | return dsa->meth->dsa_do_sign(dgst, dlen, dsa); | 
| 71 | } | 79 | } | 
| 72 | 80 | ||
| @@ -87,6 +95,10 @@ int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, | |||
| 87 | 95 | ||
| 88 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) | 96 | int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) | 
| 89 | { | 97 | { | 
| 98 | #ifdef OPENSSL_FIPS | ||
| 99 | if(FIPS_mode() && !FIPS_dsa_check(dsa)) | ||
| 100 | return 0; | ||
| 101 | #endif | ||
| 90 | return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); | 102 | return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); | 
| 91 | } | 103 | } | 
| 92 | 104 | ||
