diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-02-13 19:45:41 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-02-13 19:45:41 +0100 |
commit | e990b4f838eaa649a1849d25db5be2236632fe34 (patch) | |
tree | b099e52a8c5e3d6057a0ee8090bf81dc9660a016 /fips/dsa | |
parent | Change FIPS source and utilities to use the "FIPS_" names directly (diff) | |
download | openssl-e990b4f838eaa649a1849d25db5be2236632fe34.tar.xz openssl-e990b4f838eaa649a1849d25db5be2236632fe34.zip |
Remove dependency of dsa_sign.o and dsa_vrf.o: new functions FIPS_dsa_sig_new
and FIPS_dsa_sig_free, reimplment DSA_SIG_new and DSA_SIG_free from ASN1
library.
Diffstat (limited to 'fips/dsa')
-rw-r--r-- | fips/dsa/fips_dsa_lib.c | 23 | ||||
-rw-r--r-- | fips/dsa/fips_dsa_selftest.c | 2 | ||||
-rw-r--r-- | fips/dsa/fips_dsatest.c | 2 | ||||
-rw-r--r-- | fips/dsa/fips_dssvs.c | 2 |
4 files changed, 26 insertions, 3 deletions
diff --git a/fips/dsa/fips_dsa_lib.c b/fips/dsa/fips_dsa_lib.c index 06f8cabfee..2e2f192aff 100644 --- a/fips/dsa/fips_dsa_lib.c +++ b/fips/dsa/fips_dsa_lib.c @@ -96,3 +96,26 @@ void FIPS_dsa_free(DSA *r) OPENSSL_free(r); } +DSA_SIG *FIPS_dsa_sig_new(void) + { + DSA_SIG *sig; + sig = OPENSSL_malloc(sizeof(DSA_SIG)); + if (!sig) + return NULL; + sig->r = NULL; + sig->s = NULL; + return sig; + } + +void FIPS_dsa_sig_free(DSA_SIG *sig) + { + if (sig) + { + if (sig->r) + BN_free(sig->r); + if (sig->s) + BN_free(sig->s); + OPENSSL_free(sig); + } + } + diff --git a/fips/dsa/fips_dsa_selftest.c b/fips/dsa/fips_dsa_selftest.c index 2fbdad5d47..ee225906bd 100644 --- a/fips/dsa/fips_dsa_selftest.c +++ b/fips/dsa/fips_dsa_selftest.c @@ -156,7 +156,7 @@ int FIPS_selftest_dsa() if (dsa) FIPS_dsa_free(dsa); if (dsig) - DSA_SIG_free(dsig); + FIPS_dsa_sig_free(dsig); if (ret == 0) FIPSerr(FIPS_F_FIPS_SELFTEST_DSA,FIPS_R_SELFTEST_FAILED); return ret; diff --git a/fips/dsa/fips_dsatest.c b/fips/dsa/fips_dsatest.c index 9294286c75..3e773687a1 100644 --- a/fips/dsa/fips_dsatest.c +++ b/fips/dsa/fips_dsatest.c @@ -231,7 +231,7 @@ int main(int argc, char **argv) end: if (sig) - DSA_SIG_free(sig); + FIPS_dsa_sig_free(sig); if (dsa != NULL) FIPS_dsa_free(dsa); FIPS_md_ctx_cleanup(&mctx); #if 0 diff --git a/fips/dsa/fips_dssvs.c b/fips/dsa/fips_dssvs.c index 9ee0ccc95f..ff7f8139b3 100644 --- a/fips/dsa/fips_dssvs.c +++ b/fips/dsa/fips_dssvs.c @@ -548,7 +548,7 @@ static void siggen() pbn("R",sig->r); pbn("S",sig->s); putc('\n',stdout); - DSA_SIG_free(sig); + FIPS_dsa_sig_free(sig); FIPS_md_ctx_cleanup(&mctx); } } |