mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
fix python ut, get_ca_certs
This commit is contained in:
15
src/ssl.c
15
src/ssl.c
@@ -10126,6 +10126,8 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
|
|||||||
case ALT_NAMES_OID:
|
case ALT_NAMES_OID:
|
||||||
{
|
{
|
||||||
DNS_entry* dns = NULL;
|
DNS_entry* dns = NULL;
|
||||||
|
|
||||||
|
if (x509->subjAltNameSet && x509->altNames != NULL) {
|
||||||
/* Malloc GENERAL_NAME stack */
|
/* Malloc GENERAL_NAME stack */
|
||||||
sk = (WOLFSSL_GENERAL_NAMES*)XMALLOC(
|
sk = (WOLFSSL_GENERAL_NAMES*)XMALLOC(
|
||||||
sizeof(WOLFSSL_GENERAL_NAMES), NULL,
|
sizeof(WOLFSSL_GENERAL_NAMES), NULL,
|
||||||
@@ -10136,7 +10138,6 @@ void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, int nid, int* c,
|
|||||||
XMEMSET(sk, 0, sizeof(WOLFSSL_GENERAL_NAMES));
|
XMEMSET(sk, 0, sizeof(WOLFSSL_GENERAL_NAMES));
|
||||||
sk->type = STACK_TYPE_GEN_NAME;
|
sk->type = STACK_TYPE_GEN_NAME;
|
||||||
|
|
||||||
if (x509->subjAltNameSet && x509->altNames != NULL) {
|
|
||||||
/* alt names are DNS_entry structs */
|
/* alt names are DNS_entry structs */
|
||||||
if (c != NULL) {
|
if (c != NULL) {
|
||||||
if (x509->altNames->next != NULL) {
|
if (x509->altNames->next != NULL) {
|
||||||
@@ -41215,7 +41216,7 @@ int wolfSSL_i2d_X509_NAME_canon(WOLFSSL_X509_NAME* name, unsigned char** out)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
entry = wolfSSL_X509_NAME_get_entry(name, i);
|
entry = wolfSSL_X509_NAME_get_entry(name, i);
|
||||||
if (entry != NULL && entry->set == 1) {
|
if (entry != NULL && entry->set >= 1) {
|
||||||
const char* nameStr;
|
const char* nameStr;
|
||||||
WOLFSSL_ASN1_STRING* data;
|
WOLFSSL_ASN1_STRING* data;
|
||||||
WOLFSSL_ASN1_STRING* cano_data;
|
WOLFSSL_ASN1_STRING* cano_data;
|
||||||
@@ -41325,7 +41326,7 @@ int wolfSSL_i2d_X509_NAME(WOLFSSL_X509_NAME* name, unsigned char** out)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
entry = wolfSSL_X509_NAME_get_entry(name, i);
|
entry = wolfSSL_X509_NAME_get_entry(name, i);
|
||||||
if (entry != NULL && entry->set == 1) {
|
if (entry != NULL && entry->set >= 1) {
|
||||||
const char* nameStr;
|
const char* nameStr;
|
||||||
int type;
|
int type;
|
||||||
WOLFSSL_ASN1_STRING* data;
|
WOLFSSL_ASN1_STRING* data;
|
||||||
@@ -43744,6 +43745,14 @@ err:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name->entry[loc].set) {
|
if (name->entry[loc].set) {
|
||||||
|
#ifdef WOLFSSL_PYTHON
|
||||||
|
/* "set" is not only flag use, but also stack index position use in
|
||||||
|
* OpenSSL. Python makes tuple based on this number. Therefore,
|
||||||
|
* updating "set" by position + 1. "plus 1" means to avoid "not set"
|
||||||
|
* zero.
|
||||||
|
*/
|
||||||
|
name->entry[loc].set = loc + 1;
|
||||||
|
#endif
|
||||||
return &name->entry[loc];
|
return &name->entry[loc];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user