[BACK]Return to sshbuf-getput-crypto.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/sshbuf-getput-crypto.c between version 1.6 and 1.7

version 1.6, 2019/01/21 09:52:25 version 1.7, 2019/01/21 09:54:11
Line 28 
Line 28 
 #include "sshbuf.h"  #include "sshbuf.h"
   
 int  int
 sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM *v)  sshbuf_get_bignum2(struct sshbuf *buf, BIGNUM **valp)
 {  {
           BIGNUM *v;
         const u_char *d;          const u_char *d;
         size_t len;          size_t len;
         int r;          int r;
   
           if (valp != NULL)
                   *valp = NULL;
         if ((r = sshbuf_get_bignum2_bytes_direct(buf, &d, &len)) != 0)          if ((r = sshbuf_get_bignum2_bytes_direct(buf, &d, &len)) != 0)
                 return r;                  return r;
         if (v != NULL && BN_bin2bn(d, len, v) == NULL)          if (valp != NULL) {
                 return SSH_ERR_ALLOC_FAIL;                  if ((v = BN_new()) == NULL ||
                       BN_bin2bn(d, len, v) == NULL) {
                           BN_clear_free(v);
                           return SSH_ERR_ALLOC_FAIL;
                   }
                   *valp = v;
           }
         return 0;          return 0;
 }  }
   

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7