From 26ed38539645f18412e03a8613e3db4c6b0273c6 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 24 Mar 2025 08:20:02 +0800 Subject: identifier.go: Remove paranoid checks for buffer lengths --- identifier.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/identifier.go b/identifier.go index a291f99..4b15f0f 100644 --- a/identifier.go +++ b/identifier.go @@ -30,16 +30,10 @@ func makeIdentifierMAC(request *http.Request) (identifier []byte, mac []byte) { h.Write(stringToBytes(request.Header.Get("Accept-Language"))) h.Write(privkeyHash) identifier = h.Sum(identifier) - if len(identifier) != sha256.Size { - panic("unexpected buffer length after hashing contents") - } m := hmac.New(sha256.New, privkey) m.Write(identifier) mac = m.Sum(mac) - if len(mac) != sha256.Size { - panic("unexpected buffer length after hmac") - } return } -- cgit v1.2.3