Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib Fix a problem with o...



details:   https://anonhg.NetBSD.org/src/rev/8a9ff43afc1d
branches:  trunk
changeset: 760252:8a9ff43afc1d
user:      agc <agc%NetBSD.org@localhost>
date:      Sat Jan 01 19:53:53 2011 +0000

description:
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@localhost>

        % ssh-keygen -l -f ~/.ssh/id_rsa.pub
        1024 e1:d6:b3:28:81:26:e8:e3:66:6f:47:fe:dd:cd:b7:7d /home/user/.ssh/id_rsa.pub (RSA)
        %

ssh keys and netpgp work as above.

diffstat:

 crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 7219e2be5f62 -r 8a9ff43afc1d crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c Sat Jan 01 19:47:22 2011 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/ssh2pgp.c Sat Jan 01 19:53:53 2011 +0000
@@ -251,7 +251,7 @@
        }
 
        /* 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);
        }



Home | Main Index | Thread Index | Old Index