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

Diff for /src/usr.bin/openssl/x509.c between version 1.28 and 1.29

version 1.28, 2021/12/12 20:29:15 version 1.29, 2021/12/12 20:34:04
Line 846 
Line 846 
                         ERR_print_errors(bio_err);                          ERR_print_errors(bio_err);
                         goto end;                          goto end;
                 }                  }
                 if ((pkey = X509_REQ_get_pubkey(req)) == NULL) {                  if ((pkey = X509_REQ_get0_pubkey(req)) == NULL) {
                         BIO_printf(bio_err, "error unpacking public key\n");                          BIO_printf(bio_err, "error unpacking public key\n");
                         goto end;                          goto end;
                 }                  }
                 i = X509_REQ_verify(req, pkey);                  i = X509_REQ_verify(req, pkey);
                 EVP_PKEY_free(pkey);  
                 if (i < 0) {                  if (i < 0) {
                         BIO_printf(bio_err, "Signature verification error\n");                          BIO_printf(bio_err, "Signature verification error\n");
                         ERR_print_errors(bio_err);                          ERR_print_errors(bio_err);
Line 893 
Line 892 
                     NULL) == NULL)                      NULL) == NULL)
                         goto end;                          goto end;
   
                 if ((pkey = X509_REQ_get_pubkey(req)) == NULL)                  if ((pkey = X509_REQ_get0_pubkey(req)) == NULL)
                         goto end;                          goto end;
                 if (!X509_set_pubkey(x, pkey)) {                  if (!X509_set_pubkey(x, pkey)) {
                         EVP_PKEY_free(pkey);                          EVP_PKEY_free(pkey);
                         goto end;                          goto end;
                 }                  }
                 EVP_PKEY_free(pkey);  
         } else {          } else {
                 x = load_cert(bio_err, x509_config.infile, x509_config.informat,                  x = load_cert(bio_err, x509_config.infile, x509_config.informat,
                     NULL, "Certificate");                      NULL, "Certificate");
Line 1392 
Line 1390 
         X509_STORE_CTX *xsc = NULL;          X509_STORE_CTX *xsc = NULL;
         EVP_PKEY *upkey;          EVP_PKEY *upkey;
   
         upkey = X509_get_pubkey(xca);          upkey = X509_get0_pubkey(xca);
         if (upkey == NULL)          if (upkey == NULL)
                 goto end;                  goto end;
         EVP_PKEY_copy_parameters(upkey, pkey);          EVP_PKEY_copy_parameters(upkey, pkey);
         EVP_PKEY_free(upkey);  
   
         if ((xsc = X509_STORE_CTX_new()) == NULL)          if ((xsc = X509_STORE_CTX_new()) == NULL)
                 goto end;                  goto end;
Line 1507 
Line 1504 
 {  {
         EVP_PKEY *pktmp;          EVP_PKEY *pktmp;
   
         pktmp = X509_get_pubkey(x);          pktmp = X509_get0_pubkey(x);
         if (pktmp == NULL)          if (pktmp == NULL)
                 goto err;                  goto err;
         EVP_PKEY_copy_parameters(pktmp, pkey);          EVP_PKEY_copy_parameters(pktmp, pkey);
         EVP_PKEY_save_parameters(pktmp, 1);          EVP_PKEY_save_parameters(pktmp, 1);
         EVP_PKEY_free(pktmp);  
   
         if (!X509_set_issuer_name(x, X509_get_subject_name(x)))          if (!X509_set_issuer_name(x, X509_get_subject_name(x)))
                 goto err;                  goto err;

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