diff options
author | marha <marha@users.sourceforge.net> | 2010-03-29 17:08:02 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-03-29 17:08:02 +0000 |
commit | 15272ab4ed1e6250412fccd48200ed9eae59608f (patch) | |
tree | a5996ea67966a778a16565f19dfc2e7c7f49b376 /openssl/crypto/dsa/dsa_sign.c | |
parent | 3827301b2ea5a45ac009c3bf9f08586ff40b8506 (diff) | |
download | vcxsrv-15272ab4ed1e6250412fccd48200ed9eae59608f.tar.gz vcxsrv-15272ab4ed1e6250412fccd48200ed9eae59608f.tar.bz2 vcxsrv-15272ab4ed1e6250412fccd48200ed9eae59608f.zip |
Updated to openssl 1.0.0
Diffstat (limited to 'openssl/crypto/dsa/dsa_sign.c')
-rw-r--r-- | openssl/crypto/dsa/dsa_sign.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/openssl/crypto/dsa/dsa_sign.c b/openssl/crypto/dsa/dsa_sign.c index 4cfbbe57a..17555e589 100644 --- a/openssl/crypto/dsa/dsa_sign.c +++ b/openssl/crypto/dsa/dsa_sign.c @@ -58,38 +58,33 @@ /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ -#include <stdio.h> #include "cryptlib.h" -#include <openssl/bn.h> #include <openssl/dsa.h> #include <openssl/rand.h> -#include <openssl/asn1.h> -#ifdef OPENSSL_FIPS -#include <openssl/fips.h> -#endif - DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) { -#ifdef OPENSSL_FIPS - if(FIPS_mode() && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) - { - DSAerr(DSA_F_DSA_DO_SIGN, DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE); - return NULL; - } -#endif return dsa->meth->dsa_do_sign(dgst, dlen, dsa); } -int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) +int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, + unsigned int *siglen, DSA *dsa) { -#ifdef OPENSSL_FIPS - if(FIPS_mode() && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) + DSA_SIG *s; + RAND_seed(dgst, dlen); + s=DSA_do_sign(dgst,dlen,dsa); + if (s == NULL) { - DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MODE); - return 0; + *siglen=0; + return(0); } -#endif + *siglen=i2d_DSA_SIG(s,&sig); + DSA_SIG_free(s); + return(1); + } + +int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) + { return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); } |