diff options
author | djm <> | 2009-01-09 12:15:52 +0000 |
---|---|---|
committer | djm <> | 2009-01-09 12:15:52 +0000 |
commit | 23f8d96f0f508b8bef2602049feee9c44228d34c (patch) | |
tree | a2a7787bc00e8f6a29153b8c6d9eb5e8f73d6269 /src/lib/libcrypto/dsa/dsa_vrf.c | |
parent | 30562050421d947c3eb3c10edde6e87730b17471 (diff) | |
download | openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.gz openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.tar.bz2 openbsd-23f8d96f0f508b8bef2602049feee9c44228d34c.zip |
resolve conflicts
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_vrf.c')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_vrf.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_vrf.c b/src/lib/libcrypto/dsa/dsa_vrf.c index c4aeddd056..c75e423048 100644 --- a/src/lib/libcrypto/dsa/dsa_vrf.c +++ b/src/lib/libcrypto/dsa/dsa_vrf.c | |||
@@ -64,31 +64,21 @@ | |||
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 | #ifdef OPENSSL_FIPS | ||
68 | #include <openssl/fips.h> | ||
69 | #endif | ||
70 | |||
67 | #include <openssl/asn1_mac.h> | 71 | #include <openssl/asn1_mac.h> |
68 | 72 | ||
69 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, | 73 | int DSA_do_verify(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, |
70 | DSA *dsa) | 74 | DSA *dsa) |
71 | { | 75 | { |
76 | #ifdef OPENSSL_FIPS | ||
77 | if(FIPS_mode() && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) | ||
78 | { | ||
79 | DSAerr(DSA_F_DSA_DO_VERIFY, DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE); | ||
80 | return 0; | ||
81 | } | ||
82 | #endif | ||
72 | return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); | 83 | return dsa->meth->dsa_do_verify(dgst, dgst_len, sig, dsa); |
73 | } | 84 | } |
74 | |||
75 | /* data has already been hashed (probably with SHA or SHA-1). */ | ||
76 | /* returns | ||
77 | * 1: correct signature | ||
78 | * 0: incorrect signature | ||
79 | * -1: error | ||
80 | */ | ||
81 | int DSA_verify(int type, const unsigned char *dgst, int dgst_len, | ||
82 | const unsigned char *sigbuf, int siglen, DSA *dsa) | ||
83 | { | ||
84 | DSA_SIG *s; | ||
85 | int ret=-1; | ||
86 | |||
87 | s = DSA_SIG_new(); | ||
88 | if (s == NULL) return(ret); | ||
89 | if (d2i_DSA_SIG(&s,&sigbuf,siglen) == NULL) goto err; | ||
90 | ret=DSA_do_verify(dgst,dgst_len,s,dsa); | ||
91 | err: | ||
92 | DSA_SIG_free(s); | ||
93 | return(ret); | ||
94 | } | ||