diff options
author | Brian Smith <brian@briansmith.org> | 2015-09-11 02:20:18 +0300 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2015-09-16 02:18:44 +0300 |
commit | 1f5e9456a9f856e07cb4582f3ffe7502fb814af5 (patch) | |
tree | 8b39ed014f76e6f64eeb9669ae1a94bff583b1dc /crypto/evp | |
parent | 231cb8214511ea5784dd94a59f3e5f5fb7d39f8e (diff) |
Remove superfluous SHA-1 dependency from EVP ECDSA code.
The documentation for |ECDSA_sign| and |ECDSA_verify| says that the
|type| parameter should be zero.
Change-Id: I875d3405455c5443f5a5a5c2960a9a9f486ca5bb
Reviewed-on: https://boringssl-review.googlesource.com/5832
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/p_ec.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/crypto/evp/p_ec.c b/crypto/evp/p_ec.c index f0249600..77f213db 100644 --- a/crypto/evp/p_ec.c +++ b/crypto/evp/p_ec.c @@ -125,9 +125,7 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { static int pkey_ec_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, const uint8_t *tbs, size_t tbslen) { - int type; unsigned int sltmp; - EC_PKEY_CTX *dctx = ctx->data; EC_KEY *ec = ctx->pkey->pkey.ec; if (!sig) { @@ -138,12 +136,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, return 0; } - type = NID_sha1; - if (dctx->md) { - type = EVP_MD_type(dctx->md); - } - - if (!ECDSA_sign(type, tbs, tbslen, sig, &sltmp, ec)) { + if (!ECDSA_sign(0, tbs, tbslen, sig, &sltmp, ec)) { return 0; } *siglen = (size_t)sltmp; @@ -152,16 +145,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, static int pkey_ec_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, const uint8_t *tbs, size_t tbslen) { - int type; - EC_PKEY_CTX *dctx = ctx->data; - EC_KEY *ec = ctx->pkey->pkey.ec; - - type = NID_sha1; - if (dctx->md) { - type = EVP_MD_type(dctx->md); - } - - return ECDSA_verify(type, tbs, tbslen, sig, siglen, ec); + return ECDSA_verify(0, tbs, tbslen, sig, siglen, ctx->pkey->pkey.ec); } static int pkey_ec_derive(EVP_PKEY_CTX *ctx, uint8_t *key, |