[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.28 and 1.29

version 1.28, 2019/01/20 22:51:37 version 1.29, 2019/01/20 23:00:12
Line 404 
Line 404 
         CK_RV                   rv;          CK_RV                   rv;
         ECDSA_SIG               *ret = NULL;          ECDSA_SIG               *ret = NULL;
         u_char                  *sig;          u_char                  *sig;
         const u_char            *cp;  
   
         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 428 
Line 427 
                 error("C_Sign failed: %lu", rv);                  error("C_Sign failed: %lu", rv);
                 goto done;                  goto done;
         }          }
         cp = sig;          if (siglen < 64 || siglen > 132 || siglen % 2) {
         ret = d2i_ECDSA_SIG(NULL, &cp, siglen);                  ossl_error("d2i_ECDSA_SIG failed");
         if (ret == NULL) {                  goto done;
                 /*          }
                  * d2i_ECDSA_SIG failed, so sig does not point to a DER-encoded          bnlen = siglen/2;
                  * sequence, but to the concatenation r|s.          if ((ret = ECDSA_SIG_new()) == NULL) {
                  */                  error("ECDSA_SIG_new failed");
                 if (siglen < 64 || siglen > 132 || siglen % 2) {                  goto done;
                         ossl_error("d2i_ECDSA_SIG failed");          }
                         goto done;          if (BN_bin2bn(sig, bnlen, ret->r) == NULL ||
                 }              BN_bin2bn(sig+bnlen, bnlen, ret->s) == NULL) {
                 bnlen = siglen/2;                  ossl_error("d2i_ECDSA_SIG failed");
                 if ((ret = ECDSA_SIG_new()) == NULL) {                  ECDSA_SIG_free(ret);
                         error("ECDSA_SIG_new failed");                  ret = NULL;
                         goto done;                  goto done;
                 }  
                 if (BN_bin2bn(sig, bnlen, ret->r) == NULL ||  
                     BN_bin2bn(sig+bnlen, bnlen, ret->s) == NULL) {  
                         ossl_error("d2i_ECDSA_SIG failed");  
                         ECDSA_SIG_free(ret);  
                         ret = NULL;  
                         goto done;  
                 }  
         }          }
  done:   done:
         free(sig);          free(sig);

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29