Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key should be non null #5072

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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!;
}
}