adapters/tlsio_mbedtls.c
// this function will clone an option given by name and value
this function will clone an option given by name and value
this function will clone an option given by name and value
static void *tlsio_mbedtls_CloneOption(const char *name, const void *value)
{
    void *result = NULL;
    if (name == NULL || value == NULL)
    {
        LogError("invalid parameter detected: const char* name=%p, const void* value=%p", name, value);
        result = NULL;
    }
    else
    {
        if (strcmp(name, OPTION_UNDERLYING_IO_OPTIONS) == 0)
        {
            result = (void*)OptionHandler_Clone((OPTIONHANDLER_HANDLE)value);
        }
        else if (strcmp(name, OPTION_TRUSTED_CERT) == 0)
        {
            if (mallocAndStrcpy_s((char **)&result, value) != 0)
            {
                LogError("unable to mallocAndStrcpy_s TrustedCerts value");
                result = NULL;
            }
            else
            {
            }
        }
        else if (strcmp(name, SU_OPTION_X509_CERT) == 0)
        {
            if (mallocAndStrcpy_s((char**)&result, value) != 0)
            {
                LogError("unable to mallocAndStrcpy_s x509certificate value");
                result = NULL;
            }
            else
            {
            }
        }
        else if (strcmp(name, SU_OPTION_X509_PRIVATE_KEY) == 0)
        {
            if (mallocAndStrcpy_s((char**)&result, value) != 0)
            {
                LogError("unable to mallocAndStrcpy_s x509privatekey value");
                result = NULL;
            }
            else
            {
            }
        }
        else if (strcmp(name, OPTION_X509_ECC_CERT) == 0)
        {
            if (mallocAndStrcpy_s((char**)&result, value) != 0)
            {
                LogError("unable to mallocAndStrcpy_s x509EccCertificate value");
                result = NULL;
            }
            else
            {
            }
        }
        else if (strcmp(name, OPTION_X509_ECC_KEY) == 0)
        {
            if (mallocAndStrcpy_s((char**)&result, value) != 0)
            {
                LogError("unable to mallocAndStrcpy_s x509EccKey value");
                result = NULL;
            }
            else
            {
            }
        }
        else
        {
            LogError("not handled option : %s", name);
            result = NULL;
        }
    }
    return result;
}
static void * tlsio_mbedtls_CloneOption ( const char * name , const void * value ) { void * result = NULL ; if ( name == NULL || value == NULL ) { LogError ( " " , name , value ) ; result = NULL ; } else { if ( strcmp ( name , OPTION_UNDERLYING_IO_OPTIONS ) == 0 ) { result = ( void * ) OptionHandler_Clone ( ( OPTIONHANDLER_HANDLE ) value ) ; } else if ( strcmp ( name , OPTION_TRUSTED_CERT ) == 0 ) { if ( mallocAndStrcpy_s ( ( char * * ) & result , value ) != 0 ) { LogError ( " " ) ; result = NULL ; } else { } } else if ( strcmp ( name , SU_OPTION_X509_CERT ) == 0 ) { if ( mallocAndStrcpy_s ( ( char * * ) & result , value ) != 0 ) { LogError ( " " ) ; result = NULL ; } else { } } else if ( strcmp ( name , SU_OPTION_X509_PRIVATE_KEY ) == 0 ) { if ( mallocAndStrcpy_s ( ( char * * ) & result , value ) != 0 ) { LogError ( " " ) ; result = NULL ; } else { } } else if ( strcmp ( name , OPTION_X509_ECC_CERT ) == 0 ) { if ( mallocAndStrcpy_s ( ( char * * ) & result , value ) != 0 ) { LogError ( " " ) ; result = NULL ; } else { } } else if ( strcmp ( name , OPTION_X509_ECC_KEY ) == 0 ) { if ( mallocAndStrcpy_s ( ( char * * ) & result , value ) != 0 ) { LogError ( " " ) ; result = NULL ; } else { } } else { LogError ( " " , name ) ; result = NULL ; } } return result ; }
this function will clone an option given by name and value
this function will clone an option given by name and value
/*return as is*/ /*return as is*/ /*return as is*/ /*return as is*/ /*return as is*/