diff options
author | Nils Larsch <nils@openssl.org> | 2005-04-23 10:11:16 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-04-23 10:11:16 +0000 |
commit | 965a1cb92e4774ca2f74dad9e060aa7b2d80c77d (patch) | |
tree | 3cf53ce7ddb5caed2751f53db45b9e4ef2a2aa55 /apps | |
parent | e9ad6665a517652e8da6da5165f72c7ab8e9c34f (diff) |
change prototype of the ecdh KDF: make input parameter const and the outlen argument more flexible
Diffstat (limited to 'apps')
-rw-r--r-- | apps/speed.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/apps/speed.c b/apps/speed.c index 451a92ecd6..19b08ce9a1 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -449,11 +449,13 @@ static double Time_F(int s) static const int KDF1_SHA1_len = 20; -static void *KDF1_SHA1(void *in, size_t inlen, void *out, size_t outlen) +static void *KDF1_SHA1(const void *in, size_t inlen, void *out, size_t *outlen) { #ifndef OPENSSL_NO_SHA - if (outlen != SHA_DIGEST_LENGTH) + if (*outlen < SHA_DIGEST_LENGTH) return NULL; + else + *outlen = SHA_DIGEST_LENGTH; return SHA1(in, inlen, out); #else return NULL; @@ -2189,7 +2191,7 @@ int MAIN(int argc, char **argv) * otherwise, use result (see section 4.8 of draft-ietf-tls-ecc-03.txt). */ int field_size, outlen; - void *(*kdf)(void *in, size_t inlen, void *out, size_t xoutlen); + void *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen); field_size = EC_GROUP_get_degree(ecdh_a[j]->group); if (field_size <= 24 * 8) { |