diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/regress/lib/libcrypto/ecdh/ecdhtest.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/regress/lib/libcrypto/ecdh/ecdhtest.c b/src/regress/lib/libcrypto/ecdh/ecdhtest.c index bf9e9c007c..7d7bbf5465 100644 --- a/src/regress/lib/libcrypto/ecdh/ecdhtest.c +++ b/src/regress/lib/libcrypto/ecdh/ecdhtest.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: ecdhtest.c,v 1.19 2023/07/16 00:16:42 tb Exp $ */ | 1 | /* $OpenBSD: ecdhtest.c,v 1.20 2023/07/16 07:34:07 tb Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 | * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
| 4 | * | 4 | * |
| @@ -72,8 +72,6 @@ | |||
| 72 | #include <stdlib.h> | 72 | #include <stdlib.h> |
| 73 | #include <string.h> | 73 | #include <string.h> |
| 74 | 74 | ||
| 75 | #include <openssl/crypto.h> | ||
| 76 | #include <openssl/bio.h> | ||
| 77 | #include <openssl/bn.h> | 75 | #include <openssl/bn.h> |
| 78 | #include <openssl/objects.h> | 76 | #include <openssl/objects.h> |
| 79 | #include <openssl/sha.h> | 77 | #include <openssl/sha.h> |
| @@ -94,18 +92,16 @@ hexdump(const unsigned char *buf, size_t len) | |||
| 94 | fprintf(stdout, "\n"); | 92 | fprintf(stdout, "\n"); |
| 95 | } | 93 | } |
| 96 | 94 | ||
| 97 | static const int KDF1_SHA1_len = 20; | ||
| 98 | static void * | 95 | static void * |
| 99 | KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen) | 96 | KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen) |
| 100 | { | 97 | { |
| 101 | #ifndef OPENSSL_NO_SHA | 98 | #ifdef OPENSSL_NO_SHA |
| 99 | return NULL; | ||
| 100 | #else | ||
| 102 | if (*outlen < SHA_DIGEST_LENGTH) | 101 | if (*outlen < SHA_DIGEST_LENGTH) |
| 103 | return NULL; | 102 | return NULL; |
| 104 | else | 103 | *outlen = SHA_DIGEST_LENGTH; |
| 105 | *outlen = SHA_DIGEST_LENGTH; | ||
| 106 | return SHA1(in, inlen, out); | 104 | return SHA1(in, inlen, out); |
| 107 | #else | ||
| 108 | return NULL; | ||
| 109 | #endif | 105 | #endif |
| 110 | } | 106 | } |
| 111 | 107 | ||
| @@ -115,7 +111,7 @@ ecdh_keygen_test(int nid) | |||
| 115 | EC_KEY *keya = NULL, *keyb = NULL; | 111 | EC_KEY *keya = NULL, *keyb = NULL; |
| 116 | const EC_POINT *puba, *pubb; | 112 | const EC_POINT *puba, *pubb; |
| 117 | unsigned char *abuf = NULL, *bbuf = NULL; | 113 | unsigned char *abuf = NULL, *bbuf = NULL; |
| 118 | int len = KDF1_SHA1_len; | 114 | int len = SHA_DIGEST_LENGTH; |
| 119 | int failed = 1; | 115 | int failed = 1; |
| 120 | 116 | ||
| 121 | if ((keya = EC_KEY_new_by_curve_name(nid)) == NULL) | 117 | if ((keya = EC_KEY_new_by_curve_name(nid)) == NULL) |
