]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/05/28 10:08:55
authormouring <mouring>
Tue, 5 Jun 2001 20:46:32 +0000 (20:46 +0000)
committermouring <mouring>
Tue, 5 Jun 2001 20:46:32 +0000 (20:46 +0000)
     [authfile.c]
     key_load_private: set comment to filename for PEM keys

ChangeLog
authfile.c

index a9ecf37e0421473a0f038a975281a37928cd0b6d..d4080347d2738ee8e852c41f1910eb19e0f96596 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,9 @@
    - markus@cvs.openbsd.org 2001/05/28 08:04:39
      [ssh.c]                                   
      fix usage()                               
+   - markus@cvs.openbsd.org 2001/05/28 10:08:55            
+     [authfile.c]                                          
+     key_load_private: set comment to filename for PEM keys
 
 20010528
  - (tim) [conifgure.in] add setvbuf test needed for sftp-int.c
index 2715bdef8c4e8929c89d2f4f935e30c5b805a153..e1a9a21a169afc9226a6e2e7462ed2a86f3d4b22 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: authfile.c,v 1.33 2001/05/16 20:51:57 markus Exp $");
+RCSID("$OpenBSD: authfile.c,v 1.34 2001/05/28 10:08:55 markus Exp $");
 
 #include <openssl/err.h>
 #include <openssl/evp.h>
@@ -543,7 +543,7 @@ Key *
 key_load_private(const char *filename, const char *passphrase,
     char **commentp)
 {
-       Key *pub;
+       Key *pub, *prv;
        int fd;
 
        fd = open(filename, O_RDONLY);
@@ -558,14 +558,17 @@ key_load_private(const char *filename, const char *passphrase,
        lseek(fd, (off_t) 0, SEEK_SET);         /* rewind */
        if (pub == NULL) {
                /* closes fd */
-               return key_load_private_pem(fd, KEY_UNSPEC, passphrase,
-                   commentp);
+               prv = key_load_private_pem(fd, KEY_UNSPEC, passphrase, NULL);
+               /* use the filename as a comment for PEM */
+               if (commentp && prv)
+                       commentp = xstrdup(filename);
        } else {
                /* it's a SSH v1 key if the public key part is readable */
                key_free(pub);
                /* closes fd */
-               return key_load_private_rsa1(fd, filename, passphrase, NULL);
+               prv = key_load_private_rsa1(fd, filename, passphrase, NULL);
        }
+       return prv;
 }
 
 int
This page took 0.058102 seconds and 5 git commands to generate.