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

Diff for /src/usr.bin/ssh/sshkey.c between version 1.31 and 1.32

version 1.31, 2015/12/11 04:21:12 version 1.32, 2016/04/09 12:39:30
Line 1930 
Line 1930 
 #ifdef DEBUG_PK /* XXX */  #ifdef DEBUG_PK /* XXX */
         sshbuf_dump(b, stderr);          sshbuf_dump(b, stderr);
 #endif  #endif
         *keyp = NULL;          if (keyp != NULL)
                   *keyp = NULL;
         if ((copy = sshbuf_fromb(b)) == NULL) {          if ((copy = sshbuf_fromb(b)) == NULL) {
                 ret = SSH_ERR_ALLOC_FAIL;                  ret = SSH_ERR_ALLOC_FAIL;
                 goto out;                  goto out;
Line 2083 
Line 2084 
                 goto out;                  goto out;
         }          }
         ret = 0;          ret = 0;
         *keyp = key;          if (keyp != NULL) {
         key = NULL;                  *keyp = key;
                   key = NULL;
           }
  out:   out:
         sshbuf_free(copy);          sshbuf_free(copy);
         sshkey_free(key);          sshkey_free(key);
Line 3575 
Line 3578 
         /* The encrypted private part is not parsed by this function. */          /* The encrypted private part is not parsed by this function. */
   
         r = 0;          r = 0;
         if (keyp != NULL)          if (keyp != NULL) {
                 *keyp = pub;                  *keyp = pub;
         else                  pub = NULL;
                 sshkey_free(pub);          }
         pub = NULL;  
   
  out:   out:
         sshbuf_free(copy);          sshbuf_free(copy);
         sshkey_free(pub);          sshkey_free(pub);
Line 3601 
Line 3602 
         const struct sshcipher *cipher;          const struct sshcipher *cipher;
         struct sshkey *prv = NULL;          struct sshkey *prv = NULL;
   
         *keyp = NULL;          if (keyp != NULL)
                   *keyp = NULL;
         if (commentp != NULL)          if (commentp != NULL)
                 *commentp = NULL;                  *commentp = NULL;
   
Line 3687 
Line 3689 
                 goto out;                  goto out;
         }          }
         r = 0;          r = 0;
         *keyp = prv;          if (keyp != NULL) {
         prv = NULL;                  *keyp = prv;
                   prv = NULL;
           }
         if (commentp != NULL) {          if (commentp != NULL) {
                 *commentp = comment;                  *commentp = comment;
                 comment = NULL;                  comment = NULL;
Line 3713 
Line 3717 
         BIO *bio = NULL;          BIO *bio = NULL;
         int r;          int r;
   
         *keyp = NULL;          if (keyp != NULL)
                   *keyp = NULL;
   
         if ((bio = BIO_new(BIO_s_mem())) == NULL || sshbuf_len(blob) > INT_MAX)          if ((bio = BIO_new(BIO_s_mem())) == NULL || sshbuf_len(blob) > INT_MAX)
                 return SSH_ERR_ALLOC_FAIL;                  return SSH_ERR_ALLOC_FAIL;
Line 3780 
Line 3785 
                 goto out;                  goto out;
         }          }
         r = 0;          r = 0;
         *keyp = prv;          if (keyp != NULL) {
         prv = NULL;                  *keyp = prv;
                   prv = NULL;
           }
  out:   out:
         BIO_free(bio);          BIO_free(bio);
         if (pk != NULL)          if (pk != NULL)
Line 3795 
Line 3802 
 sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,  sshkey_parse_private_fileblob_type(struct sshbuf *blob, int type,
     const char *passphrase, struct sshkey **keyp, char **commentp)      const char *passphrase, struct sshkey **keyp, char **commentp)
 {  {
         *keyp = NULL;          if (keyp != NULL)
                   *keyp = NULL;
         if (commentp != NULL)          if (commentp != NULL)
                 *commentp = NULL;                  *commentp = NULL;
   

Legend:
Removed from v.1.31  
changed lines
  Added in v.1.32