From c4794df16c0376050a9aff613d7b2327e9087f65 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 10 Jun 2017 20:28:52 +0700 Subject: Added byte[] return when macBlock not set. --- crypto/src/crypto/modes/OCBBlockCipher.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crypto/src') diff --git a/crypto/src/crypto/modes/OCBBlockCipher.cs b/crypto/src/crypto/modes/OCBBlockCipher.cs index e7dc466e6..91fdfff18 100644 --- a/crypto/src/crypto/modes/OCBBlockCipher.cs +++ b/crypto/src/crypto/modes/OCBBlockCipher.cs @@ -237,7 +237,9 @@ namespace Org.BouncyCastle.Crypto.Modes public virtual byte[] GetMac() { - return Arrays.Clone(macBlock); + return macBlock == null + ? new byte[macSize] + : Arrays.Clone(macBlock); } public virtual int GetOutputSize(int len) -- cgit 1.5.1