Fix a problem with overrunning a base64 decoded number when decoding ssh
keys, from Anthony Bentley.
% netpgpkeys --ssh -l --hash=md5
1 key found
signature 1024/RSA (Encrypt or Sign) 666f47feddcdb77d 2002-07-02
Key fingerprint: e1d6 b328 8126 e8e3 666f 47fe ddcd b77d
uid machinename.com (/home/user/.ssh/id_rsa.pub) <user@machinename.com>
% ssh-keygen -l -f ~/.ssh/id_rsa.pub
1024 e1:d6:b3:28:81:26:e8:e3:66:6f:47:fe:dd💿b7:7d /home/user/.ssh/id_rsa.pub (RSA)
%
ssh keys and netpgp work as above.
This commit is contained in:
parent
d015d3f957
commit
f14b9450fa
|
@ -251,7 +251,7 @@ pgp_ssh2pubkey(pgp_io_t *io, const char *f, pgp_key_t *key, pgp_hash_alg_t hasht
|
|||
}
|
||||
|
||||
/* convert from base64 to binary */
|
||||
cc = bufgap_getbin(&bg, buf, (size_t)st.st_size);
|
||||
cc = bufgap_getbin(&bg, buf, (size_t)bg.bcc);
|
||||
if ((space = strchr(buf, ' ')) != NULL) {
|
||||
cc = (int)(space - buf);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue