Makes SCT_LIST_set_source return the number of successes
[openssl.git] / crypto / ct / ct_sct.c
index 35f815235f15d32223970c5051cd6be078ba7d65..8290945e513298dd08d83dc38db5a22a5a1091c1 100644 (file)
@@ -317,12 +317,11 @@ int SCT_set_source(SCT *sct, sct_source_t source)
 
 int SCT_LIST_set_source(const STACK_OF(SCT) *scts, sct_source_t source)
 {
-    int i, ret = 1;
+    int i, ret = 0;
 
     for (i = 0; i < sk_SCT_num(scts); ++i) {
-        ret = SCT_set_source(sk_SCT_value(scts, i), source);
-        if (ret != 1)
-            break;
+        if (SCT_set_source(sk_SCT_value(scts, i), source))
+            ++ret;
     }
 
     return ret;
@@ -402,7 +401,7 @@ int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx)
             goto end;
         }
 
-        issuer_pkey = X509_get_pubkey(ctx->issuer);
+        issuer_pkey = X509_get0_pubkey(ctx->issuer);
 
         if (X509_PUBKEY_set(&pub, issuer_pkey) != 1)
             goto err;