summaryrefslogtreecommitdiffhomepage
path: root/svr-authpubkey.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-11-01 00:19:25 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-11-01 00:19:25 +0800
commit35f26ff8555c0accbc5b48df0fceebab3a71c54b (patch)
tree7de6c381ae3c68e5803bb62e535136b9f56247cf /svr-authpubkey.c
parent3d733a16e9ee856a45a1fbd9a1b48005d78063f9 (diff)
parent55e7f0486a15b08122fffb22e38c71be15ef2986 (diff)
merge again
Diffstat (limited to 'svr-authpubkey.c')
-rw-r--r--svr-authpubkey.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/svr-authpubkey.c b/svr-authpubkey.c
index d483e9d..e0727de 100644
--- a/svr-authpubkey.c
+++ b/svr-authpubkey.c
@@ -125,15 +125,14 @@ void svr_auth_pubkey() {
/* create the data which has been signed - this a string containing
* session_id, concatenated with the payload packet up to the signature */
- signbuf = buf_new(ses.payload->pos + 4 + SHA1_HASH_SIZE);
- buf_putstring(signbuf, ses.session_id, SHA1_HASH_SIZE);
+ signbuf = buf_new(ses.payload->pos + 4 + ses.session_id->len);
+ buf_putbufstring(signbuf, ses.session_id);
buf_putbytes(signbuf, ses.payload->data, ses.payload->pos);
buf_setpos(signbuf, 0);
/* ... and finally verify the signature */
fp = sign_key_fingerprint(keyblob, keybloblen);
- if (buf_verify(ses.payload, key, buf_getptr(signbuf, signbuf->len),
- signbuf->len) == DROPBEAR_SUCCESS) {
+ if (buf_verify(ses.payload, key, signbuf) == DROPBEAR_SUCCESS) {
dropbear_log(LOG_NOTICE,
"Pubkey auth succeeded for '%s' with key %s from %s",
ses.authstate.pw_name, fp, svr_ses.addrstring);