diff options
author | tb <> | 2021-11-18 15:12:59 +0000 |
---|---|---|
committer | tb <> | 2021-11-18 15:12:59 +0000 |
commit | fcbeafde2ed65c70ea275419a1355e2163c3644e (patch) | |
tree | def4f76c214707c8176b8a4e3947769482cd645f /src/regress/lib | |
parent | fbe8d32d6dd4ab8cee272a3e7dcd90eb9b8f5026 (diff) | |
download | openbsd-fcbeafde2ed65c70ea275419a1355e2163c3644e.tar.gz openbsd-fcbeafde2ed65c70ea275419a1355e2163c3644e.tar.bz2 openbsd-fcbeafde2ed65c70ea275419a1355e2163c3644e.zip |
ecdsatest: make this test compile with opaque EVP_MD_CTX.
Diffstat (limited to 'src/regress/lib')
-rw-r--r-- | src/regress/lib/libcrypto/ecdsa/ecdsatest.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/regress/lib/libcrypto/ecdsa/ecdsatest.c b/src/regress/lib/libcrypto/ecdsa/ecdsatest.c index 097768d11e..c73baded43 100644 --- a/src/regress/lib/libcrypto/ecdsa/ecdsatest.c +++ b/src/regress/lib/libcrypto/ecdsa/ecdsatest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ecdsatest.c,v 1.6 2018/07/17 17:10:04 tb Exp $ */ | 1 | /* $OpenBSD: ecdsatest.c,v 1.7 2021/11/18 15:12:59 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Nils Larsch for the OpenSSL project. | 3 | * Written by Nils Larsch for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -95,16 +95,17 @@ x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) | |||
95 | const char message[] = "abc"; | 95 | const char message[] = "abc"; |
96 | unsigned char digest[20]; | 96 | unsigned char digest[20]; |
97 | unsigned int dgst_len = 0; | 97 | unsigned int dgst_len = 0; |
98 | EVP_MD_CTX md_ctx; | 98 | EVP_MD_CTX *md_ctx = NULL; |
99 | EC_KEY *key = NULL; | 99 | EC_KEY *key = NULL; |
100 | ECDSA_SIG *signature = NULL; | 100 | ECDSA_SIG *signature = NULL; |
101 | BIGNUM *r = NULL, *s = NULL; | 101 | BIGNUM *r = NULL, *s = NULL; |
102 | 102 | ||
103 | EVP_MD_CTX_init(&md_ctx); | 103 | if ((md_ctx = EVP_MD_CTX_new()) == NULL) |
104 | goto x962_int_err; | ||
104 | /* get the message digest */ | 105 | /* get the message digest */ |
105 | EVP_DigestInit(&md_ctx, EVP_ecdsa()); | 106 | EVP_DigestInit(md_ctx, EVP_ecdsa()); |
106 | EVP_DigestUpdate(&md_ctx, (const void*)message, 3); | 107 | EVP_DigestUpdate(md_ctx, (const void*)message, 3); |
107 | EVP_DigestFinal(&md_ctx, digest, &dgst_len); | 108 | EVP_DigestFinal(md_ctx, digest, &dgst_len); |
108 | 109 | ||
109 | BIO_printf(out, "testing %s: ", OBJ_nid2sn(nid)); | 110 | BIO_printf(out, "testing %s: ", OBJ_nid2sn(nid)); |
110 | /* create the key */ | 111 | /* create the key */ |
@@ -149,7 +150,7 @@ x9_62_test_internal(BIO *out, int nid, const char *r_in, const char *s_in) | |||
149 | BN_free(r); | 150 | BN_free(r); |
150 | if (s) | 151 | if (s) |
151 | BN_free(s); | 152 | BN_free(s); |
152 | EVP_MD_CTX_cleanup(&md_ctx); | 153 | EVP_MD_CTX_free(md_ctx); |
153 | return ret; | 154 | return ret; |
154 | } | 155 | } |
155 | 156 | ||