[BACK]Return to authfile.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/authfile.c between version 1.62.2.1 and 1.63

version 1.62.2.1, 2006/09/30 04:06:50 version 1.63, 2006/03/13 10:26:52
Line 1 
Line 1 
 /* $OpenBSD$ */  
 /*  /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>   * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland   * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
Line 36 
Line 35 
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */   */
   
   #include "includes.h"
   RCSID("$OpenBSD$");
   
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/stat.h>  #include <sys/stat.h>
 #include <sys/param.h>  
 #include <sys/uio.h>  
   
 #include <openssl/err.h>  #include <openssl/err.h>
 #include <openssl/evp.h>  #include <openssl/evp.h>
 #include <openssl/pem.h>  #include <openssl/pem.h>
   
 #include <errno.h>  
 #include <fcntl.h>  
 #include <stdio.h>  
 #include <stdlib.h>  
 #include <string.h>  
 #include <unistd.h>  
   
 #include "xmalloc.h"  
 #include "cipher.h"  #include "cipher.h"
   #include "xmalloc.h"
 #include "buffer.h"  #include "buffer.h"
   #include "bufaux.h"
 #include "key.h"  #include "key.h"
 #include "ssh.h"  #include "ssh.h"
 #include "log.h"  #include "log.h"
Line 194 
Line 187 
                 return 0;                  return 0;
         }          }
         fp = fdopen(fd, "w");          fp = fdopen(fd, "w");
         if (fp == NULL) {          if (fp == NULL ) {
                 error("fdopen %s failed: %s.", filename, strerror(errno));                  error("fdopen %s failed: %s.", filename, strerror(errno));
                 close(fd);                  close(fd);
                 return 0;                  return 0;
Line 221 
Line 214 
         case KEY_RSA1:          case KEY_RSA1:
                 return key_save_private_rsa1(key, filename, passphrase,                  return key_save_private_rsa1(key, filename, passphrase,
                     comment);                      comment);
                   break;
         case KEY_DSA:          case KEY_DSA:
         case KEY_RSA:          case KEY_RSA:
                 return key_save_private_pem(key, filename, passphrase,                  return key_save_private_pem(key, filename, passphrase,
                     comment);                      comment);
                   break;
         default:          default:
                 break;                  break;
         }          }
Line 542 
Line 537 
   
 Key *  Key *
 key_load_private_type(int type, const char *filename, const char *passphrase,  key_load_private_type(int type, const char *filename, const char *passphrase,
     char **commentp, int *perm_ok)      char **commentp)
 {  {
         int fd;          int fd;
   
Line 550 
Line 545 
         if (fd < 0)          if (fd < 0)
                 return NULL;                  return NULL;
         if (!key_perm_ok(fd, filename)) {          if (!key_perm_ok(fd, filename)) {
                 if (perm_ok != NULL)  
                         *perm_ok = 0;  
                 error("bad permissions: ignore key: %s", filename);                  error("bad permissions: ignore key: %s", filename);
                 close(fd);                  close(fd);
                 return NULL;                  return NULL;
         }          }
         if (perm_ok != NULL)  
                 *perm_ok = 1;  
         switch (type) {          switch (type) {
         case KEY_RSA1:          case KEY_RSA1:
                 return key_load_private_rsa1(fd, filename, passphrase,                  return key_load_private_rsa1(fd, filename, passphrase,
                     commentp);                      commentp);
                 /* closes fd */                  /* closes fd */
                   break;
         case KEY_DSA:          case KEY_DSA:
         case KEY_RSA:          case KEY_RSA:
         case KEY_UNSPEC:          case KEY_UNSPEC:
                 return key_load_private_pem(fd, type, passphrase, commentp);                  return key_load_private_pem(fd, type, passphrase, commentp);
                 /* closes fd */                  /* closes fd */
                   break;
         default:          default:
                 close(fd);                  close(fd);
                 break;                  break;

Legend:
Removed from v.1.62.2.1  
changed lines
  Added in v.1.63