@@ -4426,8 +4426,9 @@ WOLFSSL_GENERAL_NAME* wolfSSL_GENERAL_NAME_dup(WOLFSSL_GENERAL_NAME* gn)
44264426 * @return WOLFSSL_FAILURE on invalid parameter or memory error,
44274427 * WOLFSSL_SUCCESS otherwise.
44284428 */
4429- int wolfSSL_GENERAL_NAME_set0_othername (GENERAL_NAME * gen , ASN1_OBJECT * oid ,
4430- ASN1_TYPE * value ) {
4429+ int wolfSSL_GENERAL_NAME_set0_othername (WOLFSSL_GENERAL_NAME * gen ,
4430+ ASN1_OBJECT * oid , ASN1_TYPE * value )
4431+ {
44314432 WOLFSSL_ASN1_OBJECT * x = NULL ;
44324433
44334434 if ((gen == NULL ) || (oid == NULL ) || (value == NULL )) {
@@ -4830,6 +4831,37 @@ int wolfSSL_GENERAL_NAME_set_type(WOLFSSL_GENERAL_NAME* name, int typ)
48304831 return ret ;
48314832}
48324833
4834+ /* Set the value in a general name. This is a compat layer API.
4835+ *
4836+ * @param [out] a Pointer to the GENERAL_NAME where the othername is set.
4837+ * @param [in] type The type of this general name.
4838+ * @param [in] value The ASN.1 string that is the value.
4839+ * @return none
4840+ * @note the set0 indicates we take ownership so the user does NOT free value.
4841+ */
4842+ void wolfSSL_GENERAL_NAME_set0_value (WOLFSSL_GENERAL_NAME * a , int type ,
4843+ void * value )
4844+ {
4845+ WOLFSSL_ASN1_STRING * val = value ;
4846+ if (a == NULL ) {
4847+ WOLFSSL_MSG ("a is NULL" );
4848+ return ;
4849+ }
4850+
4851+ if (val == NULL ) {
4852+ WOLFSSL_MSG ("value is NULL" );
4853+ return ;
4854+ }
4855+
4856+ if (type != GEN_DNS ) {
4857+ WOLFSSL_MSG ("Only GEN_DNS is supported" );
4858+ return ;
4859+ }
4860+
4861+ wolfSSL_GENERAL_NAME_type_free (a );
4862+ a -> type = type ;
4863+ a -> d .dNSName = value ;
4864+ }
48334865
48344866/* Frees GENERAL_NAME objects.
48354867*/
0 commit comments