diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-02-12 18:25:18 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-02-12 18:25:18 +0000 |
commit | e47af46cd839c549fac2d9f8a2951c35c0113fbf (patch) | |
tree | 2fa93ea50fa6307c189711053274f8bba9949572 /fips/dsa | |
parent | 36246be9151adf1049d62f1261f87f9e3719afac (diff) |
Change FIPS source and utilities to use the "FIPS_" names directly
instead of using regular OpenSSL API names.
Diffstat (limited to 'fips/dsa')
-rw-r--r-- | fips/dsa/fips_dsa_selftest.c | 12 | ||||
-rw-r--r-- | fips/dsa/fips_dsa_sign.c | 4 | ||||
-rw-r--r-- | fips/dsa/fips_dsatest.c | 12 | ||||
-rw-r--r-- | fips/dsa/fips_dssvs.c | 16 |
4 files changed, 22 insertions, 22 deletions
diff --git a/fips/dsa/fips_dsa_selftest.c b/fips/dsa/fips_dsa_selftest.c index bc338b5aee..2fbdad5d47 100644 --- a/fips/dsa/fips_dsa_selftest.c +++ b/fips/dsa/fips_dsa_selftest.c @@ -118,7 +118,7 @@ int FIPS_selftest_dsa() EVP_MD_CTX mctx; DSA_SIG *dsig = NULL; - EVP_MD_CTX_init(&mctx); + FIPS_md_ctx_init(&mctx); dsa = FIPS_dsa_new(); @@ -134,17 +134,17 @@ int FIPS_selftest_dsa() DSA_generate_key(dsa); - if (!EVP_DigestInit_ex(&mctx, EVP_sha1(), NULL)) + if (!FIPS_digestinit(&mctx, EVP_sha1())) goto err; - if (!EVP_DigestUpdate(&mctx, str1, 20)) + if (!FIPS_digestupdate(&mctx, str1, 20)) goto err; dsig = FIPS_dsa_sign_ctx(dsa, &mctx); if (!dsig) goto err; - if (!EVP_DigestInit_ex(&mctx, EVP_sha1(), NULL)) + if (!FIPS_digestinit(&mctx, EVP_sha1())) goto err; - if (!EVP_DigestUpdate(&mctx, str1, 20)) + if (!FIPS_digestupdate(&mctx, str1, 20)) goto err; if (FIPS_dsa_verify_ctx(dsa, &mctx, dsig) != 1) goto err; @@ -152,7 +152,7 @@ int FIPS_selftest_dsa() ret = 1; err: - EVP_MD_CTX_cleanup(&mctx); + FIPS_md_ctx_cleanup(&mctx); if (dsa) FIPS_dsa_free(dsa); if (dsig) diff --git a/fips/dsa/fips_dsa_sign.c b/fips/dsa/fips_dsa_sign.c index 2875752e01..ab28cdf7d1 100644 --- a/fips/dsa/fips_dsa_sign.c +++ b/fips/dsa/fips_dsa_sign.c @@ -76,7 +76,7 @@ DSA_SIG * FIPS_dsa_sign_ctx(DSA *dsa, EVP_MD_CTX *ctx) DSA_SIG *s; unsigned char dig[EVP_MAX_MD_SIZE]; unsigned int dlen; - EVP_DigestFinal_ex(ctx, dig, &dlen); + FIPS_digestfinal(ctx, dig, &dlen); s = dsa->meth->dsa_do_sign(dig,dlen,dsa); OPENSSL_cleanse(dig, dlen); return s; @@ -92,7 +92,7 @@ int FIPS_dsa_verify_ctx(DSA *dsa, EVP_MD_CTX *ctx, DSA_SIG *s) int ret=-1; unsigned char dig[EVP_MAX_MD_SIZE]; unsigned int dlen; - EVP_DigestFinal_ex(ctx, dig, &dlen); + FIPS_digestfinal(ctx, dig, &dlen); ret=dsa->meth->dsa_do_verify(dig,dlen,s,dsa); OPENSSL_cleanse(dig, dlen); return ret; diff --git a/fips/dsa/fips_dsatest.c b/fips/dsa/fips_dsatest.c index 1bf6528962..9294286c75 100644 --- a/fips/dsa/fips_dsatest.c +++ b/fips/dsa/fips_dsatest.c @@ -156,7 +156,7 @@ int main(int argc, char **argv) BN_GENCB cb; EVP_MD_CTX mctx; BN_GENCB_set(&cb, dsa_cb, stderr); - EVP_MD_CTX_init(&mctx); + FIPS_md_ctx_init(&mctx); fips_set_error_print(); if(!FIPS_mode_set(1)) @@ -212,17 +212,17 @@ int main(int argc, char **argv) } DSA_generate_key(dsa); - if (!EVP_DigestInit_ex(&mctx, EVP_sha1(), NULL)) + if (!FIPS_digestinit(&mctx, EVP_sha1())) goto end; - if (!EVP_DigestUpdate(&mctx, str1, 20)) + if (!FIPS_digestupdate(&mctx, str1, 20)) goto end; sig = FIPS_dsa_sign_ctx(dsa, &mctx); if (!sig) goto end; - if (!EVP_DigestInit_ex(&mctx, EVP_sha1(), NULL)) + if (!FIPS_digestinit(&mctx, EVP_sha1())) goto end; - if (!EVP_DigestUpdate(&mctx, str1, 20)) + if (!FIPS_digestupdate(&mctx, str1, 20)) goto end; if (FIPS_dsa_verify_ctx(dsa, &mctx, sig) != 1) goto end; @@ -233,7 +233,7 @@ end: if (sig) DSA_SIG_free(sig); if (dsa != NULL) FIPS_dsa_free(dsa); - EVP_MD_CTX_cleanup(&mctx); + FIPS_md_ctx_cleanup(&mctx); #if 0 CRYPTO_mem_leaks(bio_err); #endif diff --git a/fips/dsa/fips_dssvs.c b/fips/dsa/fips_dssvs.c index a3261af6c4..9ee0ccc95f 100644 --- a/fips/dsa/fips_dssvs.c +++ b/fips/dsa/fips_dssvs.c @@ -533,7 +533,7 @@ static void siggen() int n; EVP_MD_CTX mctx; DSA_SIG *sig; - EVP_MD_CTX_init(&mctx); + FIPS_md_ctx_init(&mctx); n=hex2bin(value,msg); @@ -541,15 +541,15 @@ static void siggen() exit(1); pbn("Y",dsa->pub_key); - EVP_DigestInit_ex(&mctx, md, NULL); - EVP_DigestUpdate(&mctx, msg, n); + FIPS_digestinit(&mctx, md); + FIPS_digestupdate(&mctx, msg, n); sig = FIPS_dsa_sign_ctx(dsa, &mctx); pbn("R",sig->r); pbn("S",sig->s); putc('\n',stdout); DSA_SIG_free(sig); - EVP_MD_CTX_cleanup(&mctx); + FIPS_md_ctx_cleanup(&mctx); } } if (dsa) @@ -606,15 +606,15 @@ static void sigver() { EVP_MD_CTX mctx; int r; - EVP_MD_CTX_init(&mctx); + FIPS_md_ctx_init(&mctx); sig->s=hex2bn(value); - EVP_DigestInit_ex(&mctx, md, NULL); - EVP_DigestUpdate(&mctx, msg, n); + FIPS_digestinit(&mctx, md); + FIPS_digestupdate(&mctx, msg, n); no_err = 1; r = FIPS_dsa_verify_ctx(dsa, &mctx, sig); no_err = 0; - EVP_MD_CTX_cleanup(&mctx); + FIPS_md_ctx_cleanup(&mctx); printf("Result = %c\n", r == 1 ? 'P' : 'F'); putc('\n',stdout); |