aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-08-26 21:19:20 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-08-26 21:19:49 +0200
commit5a0735d1e8ba67cf2cc3d035eec15a15bfb1aa0e (patch)
treef58ce6de90554955c29a9a9dedcc12137b954ef1
parentf1634d33da5f918d46c9643c9c9a508500138b6b (diff)
downloadlibssh-5a0735d1e8ba67cf2cc3d035eec15a15bfb1aa0e.tar.gz
libssh-5a0735d1e8ba67cf2cc3d035eec15a15bfb1aa0e.tar.xz
libssh-5a0735d1e8ba67cf2cc3d035eec15a15bfb1aa0e.zip
messages: Fix ssh_packet_userauth_request().
Remove useless ssh_pki_import_signature_blob().
-rw-r--r--src/messages.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/messages.c b/src/messages.c
index cf4dd23..ca2df01 100644
--- a/src/messages.c
+++ b/src/messages.c
@@ -589,7 +589,6 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_NONE;
// has a valid signature ?
if(has_sign) {
- ssh_signature sig;
ssh_string sig_blob = NULL;
ssh_buffer digest = NULL;
@@ -599,20 +598,10 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_ERROR;
goto error;
}
- rc = ssh_pki_import_signature_blob(sig_blob,
- msg->auth_request.pubkey,
- &sig);
- if (rc < 0) {
- ssh_string_free(sig_blob);
- ssh_log(session, SSH_LOG_PACKET, "Wrong signature from peer");
- msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_WRONG;
- goto error;
- }
digest = ssh_msg_userauth_build_digest(session, msg, service_c);
if (digest == NULL) {
ssh_string_free(sig_blob);
- ssh_signature_free(sig);
ssh_log(session, SSH_LOG_PACKET, "Failed to get digest");
msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_WRONG;
goto error;
@@ -626,6 +615,9 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_request){
ssh_string_free(sig_blob);
ssh_buffer_free(digest);
if (rc < 0) {
+ ssh_log(session,
+ SSH_LOG_PACKET,
+ "Received an invalid signature from peer");
msg->auth_request.signature_state = SSH_PUBLICKEY_STATE_WRONG;
goto error;
}