summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRob Percival <robpercival@google.com>2016-08-15 14:47:02 +0100
committerRich Salz <rsalz@openssl.org>2016-08-15 12:56:47 -0400
commit11c68ceaa6bd93f4c2de4ae34bb1852729447d45 (patch)
treeded9cefbc9fcba492dc90da87cd02882eab67cdf /include
parenta1bb7708cec057fe07d987398015c01e6090891f (diff)
Make CT_POLICY_EVAL_CTX_set1_{cert,issuer} into boolean functions
They may fail if they cannot increment the reference count of the certificate they are storing a pointer for. They should return 0 if this occurs. Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1408)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/ct.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/openssl/ct.h b/include/openssl/ct.h
index 52ea6a269a..e753fc94b8 100644
--- a/include/openssl/ct.h
+++ b/include/openssl/ct.h
@@ -70,14 +70,22 @@ void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx);
/* Gets the peer certificate that the SCTs are for */
X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx);
-/* Sets the certificate associated with the received SCTs */
-void CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
+/*
+ * Sets the certificate associated with the received SCTs.
+ * Incremenets the reference count of cert.
+ * Returns 1 on success, 0 otherwise.
+ */
+int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert);
/* Gets the issuer of the aforementioned certificate */
X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx);
-/* Sets the issuer of the certificate associated with the received SCTs */
-void CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
+/*
+ * Sets the issuer of the certificate associated with the received SCTs.
+ * Increments the reference count of issuer.
+ * Returns 1 on success, 0 otherwise.
+ */
+int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer);
/* Gets the CT logs that are trusted sources of SCTs */
const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx);