I Send you email...

Please answer to me....

To use Signiture verification, I make these code.

Error happened while using wc_RsaPublicKeyDecode

that function is seem to get rsakey info from string.


    ret = wc_Sha256Hash((const byte*)token, strlen(token), ucSha256Hashed);
    if(ret != 0)
    {
        printf("Error wc_Sha256Hash ret = %d", ret);
        return -25;
    }

    RsaKey rsaKey;
    word32 idx = 0;

    XMEMSET(&rsaKey, 0, sizeof(rsaKey));

    word32 pksize = (word32)wolfSSL_X509_get_pubkey( parse_jason->x509Cert[0] )->pkey_sz;
    const byte * pubkey = (const unsigned char*) wolfSSL_X509_get_pubkey( parse_jason->x509Cert[0] )->pkey.ptr;

    if(pubkey == NULL)
        printf("pubkey is NULL");
    else
        printf("pubkey is not NULL");

    PLOG("%s, pksize %d", __func__, pksize);

    ret = wc_InitRsaKey(&rsaKey, NULL);
    if(ret != 0)
    {
        printf("Error wc_InitRsaKey ret = %d", ret);
        return -25;
    }

    ret = wc_RsaPublicKeyDecode(pubkey, &idx, &rsaKey, pksize);   <-- Error Msg Occurred
    PLOG("wc_RsaPublicKeyDecode ret = %d", ret);
    if (ret != 0)
    {
        // error parsing public key 
        memset( err_string, 0x00, sizeof(err_string) );       

        printf("%s failed ! wc_RsaPublicKeyDecode error %d", __func__, ret);
        return -28;
    } else {
        printf("%s success ! wc_RsaPublicKeyDecode success", __func__);
    }

    ret = wc_SignatureVerify(WC_HASH_TYPE_SHA256, WC_SIGNATURE_TYPE_RSA_W_ENC,
                            (const byte*)ucSha256Hashed, sizeof(ucSha256Hashed),
                            (const byte*)ucSignatureBase64decoded, nLengthSigDecoded,
                            &rsaKey, 300);

    free(token);

    free (ucSignatureBase64decoded);

    wc_FreeRsaKey( &rsaKey );

Error Message is ......

wc_Sha256Hash ret = 0
pubkey is not NULL
check_signature_verification, pksize 270
wc_InitRsaKey ret = 0

then

Process 1110071 (-) terminated SIGSEGV code=1 fltno=11 ip=0000000011b538d8(/usr/lib/libwolfssl.so.12@wc_DhSetKey+0x0000000000000edc) mapaddr=000000000001c8d8. ref=10bc352000000000

could you answer why this error happened?

wait your answer....

thanks..

I use AESGCM SHA256

when I create the IV. IV Size is 4 byte

but I Have to use 16byte string..

How to Increase 4byte string to 16byte string ?

regards.

thanks.

thanks for your answer

in developing SW using wolfssl, I wonder internal.h and options.h

I think both of them are related in wolfssl

when I use both these header file, which one shell I defined ?

#include <wolfssl/internal.h>
#include <wolfssl/options.h>

or

#include <wolfssl/options.h>
#include <wolfssl/internal.h>

thanks

I don't know how to make ECDH using wolfssl api.

especially, encryption and decryption.

give me answer, plz.

Is there any ECDH examples using wolfssl api

regards

thanks

To Setup pre-shared key, mbedtls_ssl_conf_psk function is used in mbedtls.

is there any method to Setup pre-shared key?

I have Not to use callback function.
   such as (wolfSSL_CTX_set_psk_client_callback function(ctx, My_Psk_Client_cb))

Regards

Because, I have to check TLS Handshake Process between Client and Hello using cipher.

So, I need such as SendClientHello, SendServerHello, SendCertificate, SendClientKeyExchange, SendCertificateVerify, etc ...

when i googling wolfssl,I found these functions.

So. I Had a question, that Is, Is there any method to use these functions?

thanks.

Because, I have to check TLS Handshake Process between Client and Hello using cipher.

So, I need such as SendClientHello, SendServerHello, SendCertificate, SendClientKeyExchange, SendCertificateVerify, etc ...

thanks

thanks

I want to use these functions

    WOLFSSL_LOCAL int SendClientHello(WOLFSSL*);
    WOLFSSL_LOCAL int SendClientKeyExchange(WOLFSSL*);
    WOLFSSL_LOCAL int SendCertificateVerify(WOLFSSL*);

but it's not easy to use it.

How to use these function in my Source code ?

give me an answer.

please ..

regards

while I googling the SendClientHello function

I wonder between WOLFSSL_LOCAL and WOLF_API function

if possible,
Could you answer to me, how to use SendClientHello() function?

regards..

whenever I use EccKeyToDer, these error happened.

Description    Resource    Path    Location    Type
'EccKeyToDer' was not declared in this scope

but, I don't know how to use this function...

I think lt's a Kind of Flag....

please. answer to me ...

regards

15

(1 replies, posted in General Inquiries)

How to use ctr-drbg ?

please answer to me.

1. how to use configure options ?

2. how to use define Flag ?

3. c++ examples

regards

thanks

dgarske wrote:

Hi kjjy7,

If you are using ./configure you do not need to use user_settings.h. The ./configure outputs a build configuration file to wolfssl/options.h. You can use this file as a template for user_settings.h if you are building the sources directly (without ./configure).

If you are building sources directly then you can define WOLFSSL_USER_SETTINGS and add a user_settings.h file to your include path. There is an excellent template for this here: https://github.com/wolfSSL/wolfssl/blob … settings.h

Thanks,
David Garske, wolfSSL

thanks

I have to use Cipher ECDH_ECDSA_WITH_AES_128_GCM_SHA256.

I heard that the configure option of wolfssl is

./configure CFLAGS="-DWOLFSSL_STATIC_RSA -DWOLFSSL_HAVE_MAX -fPIC -fstack-protector " --enable-opensslextra --enable-fortress --enable-aesgcm=table --enable-ecc --enable-eccencrypt --enable-tlsx --enable-hkdf --enable-sha512

but when I check the functions, I found that some of functions don't work. (such as ecc)

when i found the cause, it's due to "user_setting.h" file

there is no user_setting.h on my source code.

In the web tutorial, 'user_setting.h' files is located in include path.



first, Is this right to configure above options?

second, How to make the user_setting.h, using above all configure option?



Regards

thanks ...

dgarske wrote:

Hi kjjy7,

Try using the function `wolfSSL_get_state`. We also have an API `wolfSSL_state_string_long` which gets a string version of the current state.

We also have an internal TLS client state is in `ssl->options.clientState`. The possible values are here: https://github.com/wolfSSL/wolfssl/blob … al.h#L1428

Let us know if that is helpful or not.

Thanks,
David Garske, wolfSSL

thanks

Kaleb J. Himes wrote:

Hi kjjy7,

Please check the state by defining DEBUG_WOLFSSL or configuring with --enable-debug then call

wolfSSL_Debugging_ON(); 

in your application!

Warm Regards,

- Kaleb

thanks

How do I get the TLS handshake status using wolfssl?


I couldn't find TLS handshake state in wolfssl library example.

(such as

case client_Hello:

case server_hello:

case certificate:
....
)

could you answer me how to check the tls state?

regards