X-Git-Url: https://tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Fopenssl%2Fprf.c;h=a402b8ff8498b7e405fcca2858a06aedfa2034ca;hb=7eeb29220a73ab9c5367f652873042f8a81c6cef;hp=5d597d9ad793ea51070d719da2247eafc41860eb;hpb=bcac314fe2d758e85335d499dbb4300bfa8a599e;p=tinc diff --git a/src/openssl/prf.c b/src/openssl/prf.c index 5d597d9a..a402b8ff 100644 --- a/src/openssl/prf.c +++ b/src/openssl/prf.c @@ -29,7 +29,7 @@ We use SHA512 instead of MD5 and SHA1. */ -static bool prf_xor(int nid, const uint8_t *secret, size_t secretlen, uint8_t *seed, size_t seedlen, uint8_t *out, size_t outlen) { +static bool prf_xor(nid_t nid, const uint8_t *secret, size_t secretlen, uint8_t *seed, size_t seedlen, uint8_t *out, size_t outlen) { digest_t digest = {0}; if(!digest_open_by_nid(&digest, nid, DIGEST_ALGO_SIZE)) { @@ -48,11 +48,11 @@ static bool prf_xor(int nid, const uint8_t *secret, size_t secretlen, uint8_t *s It consists of the previous HMAC result plus the seed. */ - char data[len + seedlen]; + char *data = alloca(len + seedlen); memset(data, 0, len); memcpy(data + len, seed, seedlen); - uint8_t hash[len]; + uint8_t *hash = alloca(len); while(outlen > 0) { /* Inner HMAC */