File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -11630,15 +11630,20 @@ int wolfSSL_i2d_X509_NAME_canon(WOLFSSL_X509_NAME* name, unsigned char** out)
1163011630 }
1163111631 nameStr = (const char * )wolfSSL_ASN1_STRING_data (cano_data );
1163211632
11633- ret = wc_EncodeNameCanonical (& names [i ], nameStr , CTC_UTF8 ,
11634- (byte )ConvertNIDToWolfSSL (entry -> nid ));
11635- if (ret < 0 ) {
11636- WC_FREE_VAR_EX (names , NULL , DYNAMIC_TYPE_TMP_BUFFER );
11637- wolfSSL_ASN1_STRING_free (cano_data );
11638- WOLFSSL_MSG ("EncodeName failed" );
11639- return WOLFSSL_FATAL_ERROR ;
11633+ /* allow for blank values in the name structure, eg OU= */
11634+ if (nameStr )
11635+ {
11636+ ret = wc_EncodeNameCanonical (& names [i ], nameStr , CTC_UTF8 ,
11637+ (byte )ConvertNIDToWolfSSL (entry -> nid ));
11638+ if (ret < 0 ) {
11639+ WC_FREE_VAR_EX (names , NULL , DYNAMIC_TYPE_TMP_BUFFER );
11640+ wolfSSL_ASN1_STRING_free (cano_data );
11641+ WOLFSSL_MSG ("EncodeName failed" );
11642+ return WOLFSSL_FATAL_ERROR ;
11643+ }
11644+ totalBytes += ret ;
1164011645 }
11641- totalBytes += ret ;
11646+
1164211647 wolfSSL_ASN1_STRING_free (cano_data );
1164311648 }
1164411649 }
You can’t perform that action at this time.
0 commit comments