Topic: Diffie-hellman keyexchange compatible with openssl

Hello, I want to use wolfSSL on my STM32 F4 device and openssl on my Windows application.
Is it possible to perform a Diffie-Hellman key exchange between both?

wc_DhGenerateKeyPair/wc_DhAgree uses a byte array, can I export or import to a format supported by both openSSL and wolfSSL? Thanks for your advice.

Share

Re: Diffie-hellman keyexchange compatible with openssl

Hi Leroyk2,

Thanks for contacting wolfSSL with your questions! Could you tell us a little about what you are working on and the end-goals of the project?

We do interoperability testing with OpenSSL on a nightly basis so the short answer is yes we are confident the two can perform a TLS connection using a DH key exchange mechanism.

It appears though your work may be a little lower level, just using the crypto parts of the two libraries and not necessarily the SSL/TLS level is that correct?

Warm Regards,

Kaleb

Re: Diffie-hellman keyexchange compatible with openssl

I need to know if I could exchange a diffie hellman public key from wolfssl to openssl

wc_DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz);
is the output of pub compatible with openssl bignum?

device x = will be used openssl DH_compute_key
device y = will be used wolfssl wc_DhAgree

Share

Re: Diffie-hellman keyexchange compatible with openssl

Leroyk2,

Could you tell us a little about what you are working on and the end-goals of the project?

The output of pub is an unsigned char array iE the raw hex.
You could convert that to Big Number format with the function wolfSSL_BN_hex2bn

Warm Regards,

Kaleb