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

Diff for /src/usr.bin/openssl/crl.c between version 1.13 and 1.14

version 1.13, 2019/07/14 03:30:45 version 1.14, 2021/10/23 14:49:39
Line 223 
Line 223 
         int ret = 1, i;          int ret = 1, i;
         BIO *out = NULL;          BIO *out = NULL;
         X509_STORE *store = NULL;          X509_STORE *store = NULL;
         X509_STORE_CTX ctx;          X509_STORE_CTX *ctx = NULL;
         X509_LOOKUP *lookup = NULL;          X509_LOOKUP *lookup = NULL;
         X509_OBJECT xobj;          X509_OBJECT xobj;
         EVP_PKEY *pkey;          EVP_PKEY *pkey;
Line 281 
Line 281 
   
         if (crl_config.verify) {          if (crl_config.verify) {
                 store = X509_STORE_new();                  store = X509_STORE_new();
                   if (store == NULL)
                           goto end;
                 lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());                  lookup = X509_STORE_add_lookup(store, X509_LOOKUP_file());
                 if (lookup == NULL)                  if (lookup == NULL)
                         goto end;                          goto end;
Line 298 
Line 300 
                             X509_FILETYPE_DEFAULT);                              X509_FILETYPE_DEFAULT);
                 ERR_clear_error();                  ERR_clear_error();
   
                 if (!X509_STORE_CTX_init(&ctx, store, NULL, NULL)) {                  if ((ctx = X509_STORE_CTX_new()) == NULL)
                           goto end;
   
                   if (!X509_STORE_CTX_init(ctx, store, NULL, NULL)) {
                         BIO_printf(bio_err,                          BIO_printf(bio_err,
                             "Error initialising X509 store\n");                              "Error initialising X509 store\n");
                         goto end;                          goto end;
                 }                  }
                 i = X509_STORE_get_by_subject(&ctx, X509_LU_X509,                  i = X509_STORE_get_by_subject(ctx, X509_LU_X509,
                     X509_CRL_get_issuer(x), &xobj);                      X509_CRL_get_issuer(x), &xobj);
                 if (i <= 0) {                  if (i <= 0) {
                         BIO_printf(bio_err,                          BIO_printf(bio_err,
                             "Error getting CRL issuer certificate\n");                              "Error getting CRL issuer certificate\n");
                         goto end;                          goto end;
                 }                  }
                 pkey = X509_get_pubkey(xobj.data.x509);                  pkey = X509_get_pubkey(X509_OBJECT_get0_X509(&xobj));
                 X509_OBJECT_free_contents(&xobj);                  X509_OBJECT_free_contents(&xobj);
                 if (!pkey) {                  if (!pkey) {
                         BIO_printf(bio_err,                          BIO_printf(bio_err,
Line 429 
Line 434 
         BIO_free_all(bio_out);          BIO_free_all(bio_out);
         bio_out = NULL;          bio_out = NULL;
         X509_CRL_free(x);          X509_CRL_free(x);
         if (store) {          X509_STORE_CTX_free(ctx);
                 X509_STORE_CTX_cleanup(&ctx);          X509_STORE_free(store);
                 X509_STORE_free(store);  
         }  
   
         return (ret);          return (ret);
 }  }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14