Commit 6b2917a2 authored by Christian Kandeler's avatar Christian Kandeler

SSH: Give better name to member variable.

No functional changes.

Change-Id: Ie75fd001c90c2eaaf3c085c92e9ab2279e1fff98
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@theqtcompany.com>
parent 8529f084
...@@ -96,7 +96,7 @@ inline const char *botanEmsaAlgoName(const QByteArray &rfcAlgoName) ...@@ -96,7 +96,7 @@ inline const char *botanEmsaAlgoName(const QByteArray &rfcAlgoName)
return "EMSA1(SHA-1)"; return "EMSA1(SHA-1)";
if (rfcAlgoName == SshCapabilities::PubKeyRsa) if (rfcAlgoName == SshCapabilities::PubKeyRsa)
return "EMSA3(SHA-1)"; return "EMSA3(SHA-1)";
if (rfcAlgoName == SshCapabilities::PubKeyEcdsa) if (rfcAlgoName == SshCapabilities::PubKeyEcdsa256)
return "EMSA1_BSI(SHA-256)"; return "EMSA1_BSI(SHA-256)";
throw SshClientException(SshInternalError, SSH_TR("Unexpected host key algorithm \"%1\"") throw SshClientException(SshInternalError, SSH_TR("Unexpected host key algorithm \"%1\"")
.arg(QString::fromLatin1(rfcAlgoName))); .arg(QString::fromLatin1(rfcAlgoName)));
......
...@@ -65,9 +65,9 @@ const QList<QByteArray> SshCapabilities::KeyExchangeMethods = QList<QByteArray>( ...@@ -65,9 +65,9 @@ const QList<QByteArray> SshCapabilities::KeyExchangeMethods = QList<QByteArray>(
const QByteArray SshCapabilities::PubKeyDss("ssh-dss"); const QByteArray SshCapabilities::PubKeyDss("ssh-dss");
const QByteArray SshCapabilities::PubKeyRsa("ssh-rsa"); const QByteArray SshCapabilities::PubKeyRsa("ssh-rsa");
const QByteArray SshCapabilities::PubKeyEcdsa("ecdsa-sha2-nistp256"); const QByteArray SshCapabilities::PubKeyEcdsa256("ecdsa-sha2-nistp256");
const QList<QByteArray> SshCapabilities::PublicKeyAlgorithms = QList<QByteArray>() const QList<QByteArray> SshCapabilities::PublicKeyAlgorithms = QList<QByteArray>()
<< SshCapabilities::PubKeyEcdsa << SshCapabilities::PubKeyEcdsa256
<< SshCapabilities::PubKeyRsa << SshCapabilities::PubKeyRsa
<< SshCapabilities::PubKeyDss; << SshCapabilities::PubKeyDss;
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
static const QByteArray PubKeyDss; static const QByteArray PubKeyDss;
static const QByteArray PubKeyRsa; static const QByteArray PubKeyRsa;
static const QByteArray PubKeyEcdsa; static const QByteArray PubKeyEcdsa256;
static const QList<QByteArray> PublicKeyAlgorithms; static const QList<QByteArray> PublicKeyAlgorithms;
static const QByteArray CryptAlgo3DesCbc; static const QByteArray CryptAlgo3DesCbc;
......
...@@ -185,7 +185,7 @@ static void getHostKeySpecificReplyData(SshKeyExchangeReply &replyData, ...@@ -185,7 +185,7 @@ static void getHostKeySpecificReplyData(SshKeyExchangeReply &replyData,
replyData.hostKeyParameters << SshPacketParser::asBigInt(input, &offset); replyData.hostKeyParameters << SshPacketParser::asBigInt(input, &offset);
} }
} else { } else {
QSSH_ASSERT_AND_RETURN(hostKeyAlgo == SshCapabilities::PubKeyEcdsa); QSSH_ASSERT_AND_RETURN(hostKeyAlgo == SshCapabilities::PubKeyEcdsa256);
if (SshPacketParser::asString(input, &offset) if (SshPacketParser::asString(input, &offset)
!= hostKeyAlgo.mid(11)) { // Without "ecdsa-sha2-" prefix. != hostKeyAlgo.mid(11)) { // Without "ecdsa-sha2-" prefix.
throw SshPacketParseException(); throw SshPacketParseException();
...@@ -221,7 +221,7 @@ SshKeyExchangeReply SshIncomingPacket::extractKeyExchangeReply(const QByteArray ...@@ -221,7 +221,7 @@ SshKeyExchangeReply SshIncomingPacket::extractKeyExchangeReply(const QByteArray
if (SshPacketParser::asString(fullSignature, &sigOffset) != hostKeyAlgo) if (SshPacketParser::asString(fullSignature, &sigOffset) != hostKeyAlgo)
throw SshPacketParseException(); throw SshPacketParseException();
replyData.signatureBlob = SshPacketParser::asString(fullSignature, &sigOffset); replyData.signatureBlob = SshPacketParser::asString(fullSignature, &sigOffset);
if (hostKeyAlgo == SshCapabilities::PubKeyEcdsa) { if (hostKeyAlgo == SshCapabilities::PubKeyEcdsa256) {
// Botan's PK_Verifier wants the signature in this format. // Botan's PK_Verifier wants the signature in this format.
quint32 blobOffset = 0; quint32 blobOffset = 0;
const Botan::BigInt r = SshPacketParser::asBigInt(replyData.signatureBlob, &blobOffset); const Botan::BigInt r = SshPacketParser::asBigInt(replyData.signatureBlob, &blobOffset);
......
...@@ -213,7 +213,7 @@ void SshKeyExchange::sendNewKeysPacket(const SshIncomingPacket &dhReply, ...@@ -213,7 +213,7 @@ void SshKeyExchange::sendNewKeysPacket(const SshIncomingPacket &dhReply,
= new RSA_PublicKey(reply.hostKeyParameters.at(1), reply.hostKeyParameters.at(0)); = new RSA_PublicKey(reply.hostKeyParameters.at(1), reply.hostKeyParameters.at(0));
sigKey.reset(rsaKey); sigKey.reset(rsaKey);
} else { } else {
QSSH_ASSERT_AND_RETURN(m_serverHostKeyAlgo == SshCapabilities::PubKeyEcdsa); QSSH_ASSERT_AND_RETURN(m_serverHostKeyAlgo == SshCapabilities::PubKeyEcdsa256);
const EC_Group domain("secp256r1"); const EC_Group domain("secp256r1");
const PointGFp point = OS2ECP(convertByteArray(reply.q), reply.q.count(), const PointGFp point = OS2ECP(convertByteArray(reply.q), reply.q.count(),
domain.get_curve()); domain.get_curve());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment