From 77438f99c83b3d3965a5672cbe6618f65c30b9b4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 9 Jan 2013 06:39:20 +0100 Subject: [PATCH] devtls: fix hmac buffer size for SHA1 hashes (from erik) the buffer isn't big enough for SHA1 hashes, which are larger than MD5 hashes. --- sys/src/9/port/devtls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/9/port/devtls.c b/sys/src/9/port/devtls.c index f853abcee..3e98eaf02 100644 --- a/sys/src/9/port/devtls.c +++ b/sys/src/9/port/devtls.c @@ -732,7 +732,7 @@ tlsrecread(TlsRec *tr) { OneWay *volatile in; Block *volatile b; - uchar *p, seq[8], header[RecHdrLen], hmac[MD5dlen]; + uchar *p, seq[8], header[RecHdrLen], hmac[MaxMacLen]; int volatile nconsumed; int len, type, ver, unpad_len; @@ -1323,7 +1323,7 @@ tlsbwrite(Chan *c, Block *b, ulong offset) tr = tlsdevs[CONV(c->qid)]; if(tr == nil) - panic("tlsbread"); + panic("tlsbwrite"); ty = TYPE(c->qid); switch(ty) {