Mercurial > dropbear
comparison signkey.c @ 1754:064f5be2fc45
Add buf_decrpos()
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 24 Oct 2020 18:56:45 +0800 |
parents | d5d25ce2a2ed |
children | fa6ff07dcc77 |
comparison
equal
deleted
inserted
replaced
1753:7c0fcd19e492 | 1754:064f5be2fc45 |
---|---|
233 TRACE2(("buf_get_pub_key keytype is %d", keytype)) | 233 TRACE2(("buf_get_pub_key keytype is %d", keytype)) |
234 | 234 |
235 *type = keytype; | 235 *type = keytype; |
236 | 236 |
237 /* Rewind the buffer back before "ssh-rsa" etc */ | 237 /* Rewind the buffer back before "ssh-rsa" etc */ |
238 buf_incrpos(buf, -len - 4); | 238 buf_decrpos(buf, len + 4); |
239 | 239 |
240 #if DROPBEAR_DSS | 240 #if DROPBEAR_DSS |
241 if (keytype == DROPBEAR_SIGNKEY_DSS) { | 241 if (keytype == DROPBEAR_SIGNKEY_DSS) { |
242 dss_key_free(key->dsskey); | 242 dss_key_free(key->dsskey); |
243 key->dsskey = m_malloc(sizeof(*key->dsskey)); | 243 key->dsskey = m_malloc(sizeof(*key->dsskey)); |
314 } | 314 } |
315 | 315 |
316 *type = keytype; | 316 *type = keytype; |
317 | 317 |
318 /* Rewind the buffer back before "ssh-rsa" etc */ | 318 /* Rewind the buffer back before "ssh-rsa" etc */ |
319 buf_incrpos(buf, -len - 4); | 319 buf_decrpos(buf, len + 4); |
320 | 320 |
321 #if DROPBEAR_DSS | 321 #if DROPBEAR_DSS |
322 if (keytype == DROPBEAR_SIGNKEY_DSS) { | 322 if (keytype == DROPBEAR_SIGNKEY_DSS) { |
323 dss_key_free(key->dsskey); | 323 dss_key_free(key->dsskey); |
324 key->dsskey = m_malloc(sizeof(*key->dsskey)); | 324 key->dsskey = m_malloc(sizeof(*key->dsskey)); |