Skip to content

Commit

Permalink
Key should be non null (#5072)
Browse files Browse the repository at this point in the history
  • Loading branch information
buyaa-n committed Jan 31, 2020
1 parent 2355a10 commit 55d91ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public abstract partial class HMAC : System.Security.Cryptography.KeyedHashAlgor
protected HMAC() { }
protected int BlockSizeValue { get { throw null; } set { } }
public string HashName { get { throw null; } set { } }
public override byte[]? Key { get { throw null; } set { } }
public override byte[] Key { get { throw null; } set { } }
public static new System.Security.Cryptography.HMAC Create() { throw null; }
public static new System.Security.Cryptography.HMAC? Create(string algorithmName) { throw null; }
protected override void Dispose(bool disposing) { }
Expand All @@ -171,7 +171,7 @@ public abstract partial class KeyedHashAlgorithm : System.Security.Cryptography.
{
protected byte[] KeyValue;
protected KeyedHashAlgorithm() { }
public virtual byte[]? Key { get { throw null; } set { } }
public virtual byte[] Key { get { throw null; } set { } }
public static new System.Security.Cryptography.KeyedHashAlgorithm Create() { throw null; }
public static new System.Security.Cryptography.KeyedHashAlgorithm? Create(string algName) { throw null; }
protected override void Dispose(bool disposing) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public string HashName
}
}

public override byte[]? Key
public override byte[] Key
{
get => base.Key;
set => base.Key = value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected KeyedHashAlgorithm() { }
public static new KeyedHashAlgorithm? Create(string algName) =>
(KeyedHashAlgorithm?)CryptoConfigForwarder.CreateFromName(algName);

public virtual byte[]? Key
public virtual byte[] Key
{
get
{
Expand All @@ -38,11 +38,11 @@ protected override void Dispose(bool disposing)
{
Array.Clear(KeyValue, 0, KeyValue.Length);
}
KeyValue = null;
KeyValue = null!;
}
base.Dispose(disposing);
}

protected byte[]? KeyValue = null;
protected byte[] KeyValue = null!;
}
}

0 comments on commit 55d91ce

Please sign in to comment.