提交 a6f5d614 编写于 作者: R Rob Percival 提交者: Rich Salz

Mkae CT_log_new_from_base64 always return 0 on failure

In one failure case, it used to return -1. That failure case
(CTLOG_new() returning NULL) was not usefully distinct from all of the
other failure cases.
Reviewed-by: NMatt Caswell <matt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1407)
上级 5e93e5fc
...@@ -149,7 +149,7 @@ int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, const char *n ...@@ -149,7 +149,7 @@ int CTLOG_new_from_base64(CTLOG **ct_log, const char *pkey_base64, const char *n
*ct_log = CTLOG_new(pkey, name); *ct_log = CTLOG_new(pkey, name);
if (*ct_log == NULL) { if (*ct_log == NULL) {
EVP_PKEY_free(pkey); EVP_PKEY_free(pkey);
return -1; return 0;
} }
return 1; return 1;
......
...@@ -408,12 +408,15 @@ __owur int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len); ...@@ -408,12 +408,15 @@ __owur int o2i_SCT_signature(SCT *sct, const unsigned char **in, size_t len);
/* /*
* Creates a new CT log instance with the given |public_key| and |name|. * Creates a new CT log instance with the given |public_key| and |name|.
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
* Should be deleted by the caller using CTLOG_free when no longer needed. * Should be deleted by the caller using CTLOG_free when no longer needed.
*/ */
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name); CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
/* /*
* Creates a new CT |ct_log| instance with the given base64 public_key and |name|. * Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
* in |pkey_base64|. The |name| is a string to help users identify this log.
* Returns 1 on success, 0 on failure.
* Should be deleted by the caller using CTLOG_free when no longer needed. * Should be deleted by the caller using CTLOG_free when no longer needed.
*/ */
int CTLOG_new_from_base64(CTLOG ** ct_log, int CTLOG_new_from_base64(CTLOG ** ct_log,
......
...@@ -3484,7 +3484,6 @@ EVP_OpenFinal 3432 1_1_0 EXIST::FUNCTION:RSA ...@@ -3484,7 +3484,6 @@ EVP_OpenFinal 3432 1_1_0 EXIST::FUNCTION:RSA
RAND_egd_bytes 3433 1_1_0 EXIST::FUNCTION:EGD RAND_egd_bytes 3433 1_1_0 EXIST::FUNCTION:EGD
UI_method_get_writer 3434 1_1_0 EXIST::FUNCTION:UI UI_method_get_writer 3434 1_1_0 EXIST::FUNCTION:UI
BN_secure_new 3435 1_1_0 EXIST::FUNCTION: BN_secure_new 3435 1_1_0 EXIST::FUNCTION:
CTLOG_new_null 3436 1_1_0 EXIST::FUNCTION:CT
SHA1_Update 3437 1_1_0 EXIST::FUNCTION: SHA1_Update 3437 1_1_0 EXIST::FUNCTION:
BIO_s_connect 3438 1_1_0 EXIST::FUNCTION:SOCK BIO_s_connect 3438 1_1_0 EXIST::FUNCTION:SOCK
EVP_MD_meth_get_init 3439 1_1_0 EXIST::FUNCTION: EVP_MD_meth_get_init 3439 1_1_0 EXIST::FUNCTION:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册