mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 04:04:39 +02:00
fix for returning NULL when text not found and add test case
This commit is contained in:
@@ -40715,6 +40715,7 @@ err:
|
|||||||
nid = wolfSSL_OBJ_txt2nid(txt);
|
nid = wolfSSL_OBJ_txt2nid(txt);
|
||||||
if (nid == NID_undef) {
|
if (nid == NID_undef) {
|
||||||
WOLFSSL_MSG("Unable to find text");
|
WOLFSSL_MSG("Unable to find text");
|
||||||
|
ne = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (ne == NULL) {
|
if (ne == NULL) {
|
||||||
|
@@ -24601,6 +24601,11 @@ static void test_wolfSSL_X509_NAME_ENTRY(void)
|
|||||||
/* Test add entry by text */
|
/* Test add entry by text */
|
||||||
AssertNotNull(entry = X509_NAME_ENTRY_create_by_txt(NULL, "commonName",
|
AssertNotNull(entry = X509_NAME_ENTRY_create_by_txt(NULL, "commonName",
|
||||||
0x0c, cn, (int)sizeof(cn)));
|
0x0c, cn, (int)sizeof(cn)));
|
||||||
|
#if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO) \
|
||||||
|
|| defined(WOLFSSL_HAPROXY) || defined(WOLFSSL_NGINX)
|
||||||
|
AssertNull(X509_NAME_ENTRY_create_by_txt(&entry, "unknown",
|
||||||
|
V_ASN1_UTF8STRING, cn, (int)sizeof(cn)));
|
||||||
|
#endif
|
||||||
AssertIntEQ(X509_NAME_add_entry(nm, entry, -1, 0), SSL_SUCCESS);
|
AssertIntEQ(X509_NAME_add_entry(nm, entry, -1, 0), SSL_SUCCESS);
|
||||||
X509_NAME_ENTRY_free(entry);
|
X509_NAME_ENTRY_free(entry);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user