mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-10-24 04:09:07 +03:00
Address review: don't write through const in X509_NAME_ENTRY_get_object
The entry's object is always set when its NID is set, so return it directly.
This commit is contained in:
committed by
Paul Adelsbach
parent
227bbcae4d
commit
8ab29dc2a8
15
src/x509.c
15
src/x509.c
@@ -15468,20 +15468,13 @@ err:
|
||||
WOLFSSL_ASN1_OBJECT* wolfSSL_X509_NAME_ENTRY_get_object(
|
||||
const WOLFSSL_X509_NAME_ENTRY *ne)
|
||||
{
|
||||
WOLFSSL_ASN1_OBJECT* object = NULL;
|
||||
|
||||
WOLFSSL_ENTER_VERBOSE("wolfSSL_X509_NAME_ENTRY_get_object");
|
||||
|
||||
if (ne != NULL) {
|
||||
/* Create object from nid - reuse existing object if possible. */
|
||||
object = wolfSSL_OBJ_nid2obj_ex(ne->nid, ne->object);
|
||||
if (object != NULL) {
|
||||
/* Cache the object in the entry. */
|
||||
((WOLFSSL_X509_NAME_ENTRY*)ne)->object = object;
|
||||
}
|
||||
if (ne == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return object;
|
||||
/* Object is set when the entry's NID is set. */
|
||||
return ne->object;
|
||||
}
|
||||
#endif /* OPENSSL_ALL || HAVE_LIGHTY || WOLFSSL_MYSQL_COMPATIBLE ||
|
||||
* HAVE_STUNNEL || WOLFSSL_NGINX || HAVE_POCO_LIB || WOLFSSL_HAPROXY */
|
||||
|
||||
Reference in New Issue
Block a user