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

Diff for /src/usr.bin/ssh/ssh-pkcs11.c between version 1.36 and 1.37

version 1.36, 2019/01/20 23:12:35 version 1.37, 2019/01/21 00:47:34
Line 414 
Line 414 
         CK_RV                   rv;          CK_RV                   rv;
         ECDSA_SIG               *ret = NULL;          ECDSA_SIG               *ret = NULL;
         u_char                  *sig;          u_char                  *sig;
           BIGNUM                  *r = NULL, *s = NULL;
   
         if ((k11 = EC_KEY_get_ex_data(ec, 0)) == NULL) {          if ((k11 = EC_KEY_get_ex_data(ec, 0)) == NULL) {
                 ossl_error("EC_KEY_get_key_method_data failed for ec");                  ossl_error("EC_KEY_get_key_method_data failed for ec");
Line 446 
Line 447 
                 error("ECDSA_SIG_new failed");                  error("ECDSA_SIG_new failed");
                 goto done;                  goto done;
         }          }
         if (BN_bin2bn(sig, bnlen, ret->r) == NULL ||          if ((r = BN_bin2bn(sig, bnlen, NULL)) == NULL ||
             BN_bin2bn(sig+bnlen, bnlen, ret->s) == NULL) {              (s = BN_bin2bn(sig+bnlen, bnlen, NULL)) == NULL) {
                 ossl_error("d2i_ECDSA_SIG failed");                  ossl_error("d2i_ECDSA_SIG failed");
                 ECDSA_SIG_free(ret);                  ECDSA_SIG_free(ret);
                 ret = NULL;                  ret = NULL;
                 goto done;                  goto done;
         }          }
           if (!ECDSA_SIG_set0(ret, r, s)) {
                   error("%s: ECDSA_SIG_set0 failed", __func__);
                   ECDSA_SIG_free(ret);
                   ret = NULL;
                   goto done;
           }
           r = s = NULL; /* now owned by ret */
           /* success */
  done:   done:
           BN_free(r);
           BN_free(s);
         free(sig);          free(sig);
   
         return (ret);          return (ret);

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37