You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Enable trim analysis and fix warnings
* Use EnableTrimAnalyzer instead of IsTrimmable
I don't know how IsTrimmable works with references
(i.e. to SshNet.Security.Cryptography)
* Add additional aot/trimming related analyzers
* Initialise the hash instance in the constructor
---------
Co-authored-by: Wojciech Nagórski <wojtpl2@gmail.com>
/// Negotiates a key exchange algorithm, and creates a <see cref="IKeyExchange" /> for the negotiated
74
74
/// algorithm.
75
75
/// </summary>
76
-
/// <param name="clientAlgorithms">A <see cref="IDictionary{String, Type}"/> of the key exchange algorithms supported by the client where the key is the name of the algorithm, and the value is the type implementing this algorithm.</param>
76
+
/// <param name="clientAlgorithms">A dictionary of the key exchange algorithms supported by the client where the key is the name of the algorithm, and the value is a factory returning this algorithm.</param>
77
77
/// <param name="serverAlgorithms">The names of the key exchange algorithms supported by the SSH server.</param>
78
78
/// <returns>
79
79
/// A <see cref="IKeyExchange"/> that was negotiated between client and server.
80
80
/// </returns>
81
81
/// <exception cref="ArgumentNullException"><paramref name="clientAlgorithms"/> is <see langword="null"/>.</exception>
82
82
/// <exception cref="ArgumentNullException"><paramref name="serverAlgorithms"/> is <see langword="null"/>.</exception>
83
83
/// <exception cref="SshConnectionException">No key exchange algorithm is supported by both client and server.</exception>
<ItemGroupCondition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0'">
18
+
<ItemGroupCondition=" '$(TargetFramework)' == 'netstandard2.0' or $([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))">
@@ -42,13 +53,16 @@ public RsaDigitalSignature(RsaKey rsaKey, HashAlgorithmName hashAlgorithmName)
42
53
/// </returns>
43
54
protectedoverridebyte[]Hash(byte[]input)
44
55
{
56
+
#if NET462
45
57
return_hash.ComputeHash(input);
58
+
#else
59
+
_hash.AppendData(input);
60
+
return_hash.GetHashAndReset();
61
+
#endif
46
62
}
47
63
48
64
#region IDisposable Members
49
65
50
-
privatebool_isDisposed;
51
-
52
66
/// <summary>
53
67
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
54
68
/// </summary>
@@ -64,31 +78,7 @@ public void Dispose()
64
78
/// <param name="disposing"><see langword="true"/> to release both managed and unmanaged resources; <see langword="false"/> to release only unmanaged resources.</param>
65
79
protectedvirtualvoidDispose(booldisposing)
66
80
{
67
-
if(_isDisposed)
68
-
{
69
-
return;
70
-
}
71
-
72
-
if(disposing)
73
-
{
74
-
varhash=_hash;
75
-
if(hash!=null)
76
-
{
77
-
hash.Dispose();
78
-
_hash=null;
79
-
}
80
-
81
-
_isDisposed=true;
82
-
}
83
-
}
84
-
85
-
/// <summary>
86
-
/// Releases unmanaged resources and performs other cleanup operations before the
87
-
/// <see cref="RsaDigitalSignature"/> is reclaimed by garbage collection.
Copy file name to clipboardExpand all lines: src/Renci.SshNet/ServiceFactory.cs
+5-16Lines changed: 5 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -79,19 +79,8 @@ public PipeStream CreatePipeStream()
79
79
returnnewPipeStream();
80
80
}
81
81
82
-
/// <summary>
83
-
/// Negotiates a key exchange algorithm, and creates a <see cref="IKeyExchange" /> for the negotiated
84
-
/// algorithm.
85
-
/// </summary>
86
-
/// <param name="clientAlgorithms">A <see cref="IDictionary{String, Type}"/> of the key exchange algorithms supported by the client where key is the name of the algorithm, and value is the type implementing this algorithm.</param>
87
-
/// <param name="serverAlgorithms">The names of the key exchange algorithms supported by the SSH server.</param>
88
-
/// <returns>
89
-
/// A <see cref="IKeyExchange"/> that was negotiated between client and server.
90
-
/// </returns>
91
-
/// <exception cref="ArgumentNullException"><paramref name="clientAlgorithms"/> is <see langword="null"/>.</exception>
92
-
/// <exception cref="ArgumentNullException"><paramref name="serverAlgorithms"/> is <see langword="null"/>.</exception>
93
-
/// <exception cref="SshConnectionException">No key exchange algorithms are supported by both client and server.</exception>
0 commit comments