diff options
author | Daniel Stenberg <daniel@haxx.se> | 2017-09-06 09:32:02 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-09-06 09:32:02 +0200 |
commit | 03bb987834a7e9e3f607a4991af3037dca1a6288 (patch) | |
tree | 27b5424df29598c7fe59139ea6551217fe2eb5b3 | |
parent | d1da545a6881dbeafff86077f696f0dc22d3fc81 (diff) | |
download | curl-bagder/sha256-digest-length.tar.gz |
vtls: switch to CURL_SHA256_DIGEST_LENGTH definebagder/sha256-digest-length
... instead of the prefix-less version since WolfSSL 3.12 now uses an
enum with that name that causes build failures for us.
Fixes #1865
Reported-by: Gisle Vanem
-rw-r--r-- | lib/vtls/vtls.c | 7 | ||||
-rw-r--r-- | lib/vtls/vtls.h | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index f15760342..a1a301e7f 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -815,13 +815,14 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, } /* compute sha256sum of public key */ - sha256sumdigest = malloc(SHA256_DIGEST_LENGTH); + sha256sumdigest = malloc(CURL_SHA256_DIGEST_LENGTH); if(!sha256sumdigest) return CURLE_OUT_OF_MEMORY; Curl_ssl->sha256sum(pubkey, pubkeylen, - sha256sumdigest, SHA256_DIGEST_LENGTH); + sha256sumdigest, CURL_SHA256_DIGEST_LENGTH); encode = Curl_base64_encode(data, (char *)sha256sumdigest, - SHA256_DIGEST_LENGTH, &encoded, &encodedlen); + CURL_SHA256_DIGEST_LENGTH, &encoded, + &encodedlen); Curl_safefree(sha256sumdigest); if(encode) diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index 3c8e32104..f1a11ea58 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -116,8 +116,8 @@ CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen, #define MD5_DIGEST_LENGTH 16 /* fixed size */ #endif -#ifndef SHA256_DIGEST_LENGTH -#define SHA256_DIGEST_LENGTH 32 /* fixed size */ +#ifndef CURL_SHA256_DIGEST_LENGTH +#define CURL_SHA256_DIGEST_LENGTH 32 /* fixed size */ #endif /* see https://tools.ietf.org/html/draft-ietf-tls-applayerprotoneg-04 */ |