[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.50 and 1.50.2.2

version 1.50, 2002/06/24 14:55:38 version 1.50.2.2, 2003/09/16 21:20:24
Line 232 
Line 232 
 {  {
         Buffer buffer;          Buffer buffer;
         Key *pub;          Key *pub;
           struct stat st;
         char *cp;          char *cp;
         int i;          int i;
         off_t len;          off_t len;
   
         len = lseek(fd, (off_t) 0, SEEK_END);          if (fstat(fd, &st) < 0) {
         lseek(fd, (off_t) 0, SEEK_SET);                  error("fstat for key file %.200s failed: %.100s",
                       filename, strerror(errno));
                   return NULL;
           }
           len = st.st_size;
   
         buffer_init(&buffer);          buffer_init(&buffer);
         cp = buffer_append_space(&buffer, len);          cp = buffer_append_space(&buffer, len);
Line 318 
Line 323 
         CipherContext ciphercontext;          CipherContext ciphercontext;
         Cipher *cipher;          Cipher *cipher;
         Key *prv = NULL;          Key *prv = NULL;
           struct stat st;
   
         len = lseek(fd, (off_t) 0, SEEK_END);          if (fstat(fd, &st) < 0) {
         lseek(fd, (off_t) 0, SEEK_SET);                  error("fstat for key file %.200s failed: %.100s",
                       filename, strerror(errno));
                   close(fd);
                   return NULL;
           }
           len = st.st_size;
   
         buffer_init(&buffer);          buffer_init(&buffer);
         cp = buffer_append_space(&buffer, len);          cp = buffer_append_space(&buffer, len);
Line 410 
Line 421 
         rsa_generate_additional_parameters(prv->rsa);          rsa_generate_additional_parameters(prv->rsa);
   
         buffer_free(&decrypted);          buffer_free(&decrypted);
   
           /* enable blinding */
           if (RSA_blinding_on(prv->rsa, NULL) != 1) {
                   error("key_load_private_rsa1: RSA_blinding_on failed");
                   goto fail;
           }
         close(fd);          close(fd);
         return prv;          return prv;
   
Line 449 
Line 466 
 #ifdef DEBUG_PK  #ifdef DEBUG_PK
                 RSA_print_fp(stderr, prv->rsa, 8);                  RSA_print_fp(stderr, prv->rsa, 8);
 #endif  #endif
                   if (RSA_blinding_on(prv->rsa, NULL) != 1) {
                           error("key_load_private_pem: RSA_blinding_on failed");
                           key_free(prv);
                           prv = NULL;
                   }
         } else if (pk->type == EVP_PKEY_DSA &&          } else if (pk->type == EVP_PKEY_DSA &&
             (type == KEY_UNSPEC||type==KEY_DSA)) {              (type == KEY_UNSPEC||type==KEY_DSA)) {
                 prv = key_new(KEY_UNSPEC);                  prv = key_new(KEY_UNSPEC);
Line 489 
Line 511 
                 error("@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @");                  error("@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @");
                 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");                  error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                 error("Permissions 0%3.3o for '%s' are too open.",                  error("Permissions 0%3.3o for '%s' are too open.",
                     st.st_mode & 0777, filename);                      (u_int)st.st_mode & 0777, filename);
                 error("It is recommended that your private key files are NOT accessible by others.");                  error("It is recommended that your private key files are NOT accessible by others.");
                 error("This private key will be ignored.");                  error("This private key will be ignored.");
                 return 0;                  return 0;
Line 604 
Line 626 
         Key *pub;          Key *pub;
         char file[MAXPATHLEN];          char file[MAXPATHLEN];
   
           /* try rsa1 private key */
         pub = key_load_public_type(KEY_RSA1, filename, commentp);          pub = key_load_public_type(KEY_RSA1, filename, commentp);
         if (pub != NULL)          if (pub != NULL)
                 return pub;                  return pub;
   
           /* try rsa1 public key */
           pub = key_new(KEY_RSA1);
           if (key_try_load_public(pub, filename, commentp) == 1)
                   return pub;
           key_free(pub);
   
           /* try ssh2 public key */
         pub = key_new(KEY_UNSPEC);          pub = key_new(KEY_UNSPEC);
         if (key_try_load_public(pub, filename, commentp) == 1)          if (key_try_load_public(pub, filename, commentp) == 1)
                 return pub;                  return pub;

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.50.2.2