diff options
Diffstat (limited to 'crypt.h')
-rw-r--r-- | crypt.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -13,7 +13,7 @@ static inline bool crypt_maccmp(const char *key, const char *query, gcry_mac_setkey(hd, key, strlen(key)); gcry_mac_write(hd, query, strlen(query)); static size_t hmacsha256_len = 32; - unsigned char hmacsha256[hmacsha256_len + 1]; + unsigned char hmacsha256[hmacsha256_len]; gcry_mac_read(hd, hmacsha256, &hmacsha256_len); gcry_mac_close(hd); char hmacsha256_str[hmacsha256_len * 2 + 1]; @@ -28,7 +28,7 @@ static inline void crypt_getnonce(char buf[], const size_t buf_len) { buf[0] = '\0'; const size_t nonce_len = buf_len / 2; - unsigned char nonce[nonce_len + 1]; + unsigned char nonce[nonce_len]; gcry_create_nonce(nonce, nonce_len); for (int i = 0; i < nonce_len; i++) sprintf(buf, "%s%02x", buf, nonce[i]); |