diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-10 20:28:52 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2017-06-10 20:28:52 +0700 |
commit | c4794df16c0376050a9aff613d7b2327e9087f65 (patch) | |
tree | 693adc27715cfdb3ead3932ea68bf6b5c9e054ba | |
parent | Stop decoding exceptions escaping from GetDecoderStream (diff) | |
download | BouncyCastle.NET-ed25519-c4794df16c0376050a9aff613d7b2327e9087f65.tar.xz |
Added byte[] return when macBlock not set.
-rw-r--r-- | crypto/src/crypto/modes/OCBBlockCipher.cs | 4 |
1 files changed, 3 insertions, 1 deletions
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) |