commit | aa99c4ccd95b2da7d2ccc916b287faf509146e99 | [log] [tgz] |
---|---|---|
author | Christopher Collins <ccollins@apache.org> | Thu Aug 20 14:07:48 2020 -0700 |
committer | ccollins476ad <ccollins476ad@gmail.com> | Thu Aug 20 14:46:32 2020 -0700 |
tree | eb19c4ad7fa60d6d815e4aa5398b717fb2958e07 | |
parent | 7b5e1d873e28c52aa9142f0ee5194b3069a9457d [diff] |
sec: Fix infinite loop If the caller of EncryptAES() supplied a nonce shorter than 16 bytes, the function would enter an endless loop.
diff --git a/sec/encrypt.go b/sec/encrypt.go index 8d142e3..97aaaec 100644 --- a/sec/encrypt.go +++ b/sec/encrypt.go
@@ -263,7 +263,7 @@ iv := nonce for len(iv) < 16 { - iv = append(nonce, 0) + iv = append(iv, 0) } stream := cipher.NewCTR(blk, iv)