-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Adjust version to be in sync with SSH.NET - Add ssh-rsa hash signatures
- Loading branch information
Showing
13 changed files
with
71 additions
and
102 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Security.Cryptography; | ||
using Renci.SshNet.Security.Cryptography; | ||
|
||
namespace SshNet.Agent.Keys | ||
{ | ||
internal class AgentRsaSignature : DigitalSignature | ||
{ | ||
private readonly SshAgent _agent; | ||
private readonly IAgentKey _agentKey; | ||
private readonly HashAlgorithmName _hashAlgorithmName; | ||
|
||
public AgentRsaSignature(SshAgent agent, RsaAgentKey agentKey) | ||
: this(agent, agentKey, HashAlgorithmName.SHA1) | ||
{ | ||
} | ||
|
||
public AgentRsaSignature(SshAgent agent, RsaAgentKey agentKey, HashAlgorithmName hashAlgorithmName) | ||
{ | ||
_agent = agent; | ||
_agentKey = agentKey; | ||
_hashAlgorithmName = hashAlgorithmName; | ||
} | ||
|
||
public override bool Verify(byte[] input, byte[] signature) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public override byte[] Sign(byte[] input) | ||
{ | ||
uint flags = 0; | ||
if (_hashAlgorithmName == HashAlgorithmName.SHA256) | ||
flags = 2; // SSH_AGENT_RSA_SHA2_256 | ||
else if (_hashAlgorithmName == HashAlgorithmName.SHA512) | ||
flags = 4; // SSH_AGENT_RSA_SHA2_512 | ||
|
||
return _agent.Sign(_agentKey, input, flags); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters