]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer-tls: accomodate trailing \0 in hash output 2198/head
authorJason Ish <ish@unx.ca>
Tue, 23 Aug 2016 16:53:49 +0000 (10:53 -0600)
committerJason Ish <ish@unx.ca>
Tue, 23 Aug 2016 17:15:19 +0000 (11:15 -0600)
src/app-layer-tls-handshake.c

index c95fd4373a05d27f939913439caf059d44814bff..bc99097b206cbac4d62ba55bee7b4dab64f33569 100644 (file)
@@ -181,7 +181,7 @@ int DecodeTLSHandshakeServerCertificate(SSLState *ssl_state, uint8_t *input,
             if (i == 0 && ssl_state->server_connp.cert0_fingerprint == NULL) {
                 int msg_len = cur_cert_length;
                 int hash_len = 20;
-                int out_len = 60;
+                int out_len = hash_len * 3 + 1;
                 char out[out_len];
                 unsigned char *hash;
                 hash = ComputeSHA1((unsigned char *) input, (int) msg_len);