Skip to content

Run integration tests on alpine:latest #1553

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

Closed
wants to merge 10 commits into from
Closed
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
1 change: 0 additions & 1 deletion src/Renci.SshNet/ConnectionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,6 @@ public ConnectionInfo(string host, int port, string username, ProxyTypes proxyTy
hostAlgs.Add("rsa-sha2-512", data => { var key = new RsaKey(new SshKeyData(data)); return new KeyHostAlgorithm("rsa-sha2-512", key, new RsaDigitalSignature(key, HashAlgorithmName.SHA512)); });
hostAlgs.Add("rsa-sha2-256", data => { var key = new RsaKey(new SshKeyData(data)); return new KeyHostAlgorithm("rsa-sha2-256", key, new RsaDigitalSignature(key, HashAlgorithmName.SHA256)); });
hostAlgs.Add("ssh-rsa", data => new KeyHostAlgorithm("ssh-rsa", new RsaKey(new SshKeyData(data))));
hostAlgs.Add("ssh-dss", data => new KeyHostAlgorithm("ssh-dss", new DsaKey(new SshKeyData(data))));
#pragma warning restore SA1107 // Code should not contain multiple statements on one line
HostKeyAlgorithms = hostAlgs;

Expand Down
2 changes: 0 additions & 2 deletions src/Renci.SshNet/PrivateKeyFile.PKCS1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public Key Parse()
{
case "RSA PRIVATE KEY":
return new RsaKey(decryptedData);
case "DSA PRIVATE KEY":
return new DsaKey(decryptedData);
case "EC PRIVATE KEY":
return new EcdsaKey(decryptedData);
default:
Expand Down
21 changes: 0 additions & 21 deletions src/Renci.SshNet/PrivateKeyFile.PKCS8.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,6 @@ public Key Parse()
return new RsaKey(key);
}

if (algorithmOid.Equals(X9ObjectIdentifiers.IdDsa))
{
var parameters = privateKeyInfo.PrivateKeyAlgorithm.Parameters.GetDerEncoded();
var parametersReader = new AsnReader(parameters, AsnEncodingRules.BER);
var sequenceReader = parametersReader.ReadSequence();
parametersReader.ThrowIfNotEmpty();

var p = sequenceReader.ReadInteger();
var q = sequenceReader.ReadInteger();
var g = sequenceReader.ReadInteger();
sequenceReader.ThrowIfNotEmpty();

var keyReader = new AsnReader(key, AsnEncodingRules.BER);
var x = keyReader.ReadInteger();
keyReader.ThrowIfNotEmpty();

var y = BigInteger.ModPow(g, x, p);

return new DsaKey(p, q, g, y, x);
}

if (algorithmOid.Equals(X9ObjectIdentifiers.IdECPublicKey))
{
var parameters = privateKeyInfo.PrivateKeyAlgorithm.Parameters.GetDerEncoded();
Expand Down
12 changes: 2 additions & 10 deletions src/Renci.SshNet/PrivateKeyFile.PuTTY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,12 @@ public Key Parse()
var prv = privateKeyReader.ReadBignum2();
parsedKey = new EcdsaKey(curve, pub, prv);
break;
case "ssh-dss":
var p = publicKeyReader.ReadBignum();
var q = publicKeyReader.ReadBignum();
var g = publicKeyReader.ReadBignum();
var y = publicKeyReader.ReadBignum();
var x = privateKeyReader.ReadBignum();
parsedKey = new DsaKey(p, q, g, y, x);
break;
case "ssh-rsa":
var exponent = publicKeyReader.ReadBignum(); // e
var modulus = publicKeyReader.ReadBignum(); // n
var d = privateKeyReader.ReadBignum(); // d
p = privateKeyReader.ReadBignum(); // p
q = privateKeyReader.ReadBignum(); // q
var p = privateKeyReader.ReadBignum(); // p
var q = privateKeyReader.ReadBignum(); // q
var inverseQ = privateKeyReader.ReadBignum(); // iqmp
parsedKey = new RsaKey(modulus, exponent, d, p, q, inverseQ);
break;
Expand Down
15 changes: 0 additions & 15 deletions src/Renci.SshNet/PrivateKeyFile.SSHCOM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,6 @@ public Key Parse()
var p = reader.ReadBigIntWithBits(); // q
return new RsaKey(modulus, exponent, d, p, q, inverseQ);
}
else if (keyType.Contains("dsa"))
{
var zero = reader.ReadUInt32();
if (zero != 0)
{
throw new SshException("Invalid private key");
}

var p = reader.ReadBigIntWithBits();
var g = reader.ReadBigIntWithBits();
var q = reader.ReadBigIntWithBits();
var y = reader.ReadBigIntWithBits();
var x = reader.ReadBigIntWithBits();
return new DsaKey(p, q, g, y, x);
}

throw new NotSupportedException(string.Format("Key type '{0}' is not supported.", keyType));
}
Expand Down
4 changes: 0 additions & 4 deletions src/Renci.SshNet/PrivateKeyFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,6 @@ private void Open(Stream privateKey, string? passPhrase)
_hostAlgorithms.Add(new KeyHostAlgorithm("rsa-sha2-256", _key, new RsaDigitalSignature(rsaKey, HashAlgorithmName.SHA256)));
#pragma warning restore CA2000 // Dispose objects before losing scope
}
else if (_key is DsaKey)
{
_hostAlgorithms.Add(new KeyHostAlgorithm("ssh-dss", _key));
}
else
{
_hostAlgorithms.Add(new KeyHostAlgorithm(_key.ToString(), _key));
Expand Down
3 changes: 0 additions & 3 deletions src/Renci.SshNet/Security/Certificate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ private Key ReadPublicKey(out SshKeyData keyData)
case "[email protected]":
keyData = new SshKeyData("ssh-rsa", LoadPublicKeys(2));
return new RsaKey(keyData);
case "[email protected]":
keyData = new SshKeyData("ssh-dss", LoadPublicKeys(4));
return new DsaKey(keyData);
case "[email protected]":
case "[email protected]":
case "[email protected]":
Expand Down
86 changes: 0 additions & 86 deletions src/Renci.SshNet/Security/Cryptography/DsaDigitalSignature.cs

This file was deleted.

Loading