Re: [openssl-users] EVP_PKEY_set1_EC_KEY seems to not set something that EVP_PKEY_derive needs

2017-03-11 Thread Ethan Rahn
Wow, That was quite the oversight of mine. That fixed the issue. Thanks so much, I appreciate your patience in dealing with my confusion over the APIs! Cheers, Ethan On Sat, Mar 11, 2017 at 12:28 PM, Matt Caswell wrote: > > > On 11/03/17 18:38, Ethan Rahn wrote: > >

Re: [openssl-users] EVP_PKEY_set1_EC_KEY seems to not set something that EVP_PKEY_derive needs

2017-03-11 Thread Matt Caswell
On 11/03/17 18:38, Ethan Rahn wrote: >size_t sharedSecretLen = 0; Set this to sizeof(sharedSecret). > >// Now derive the Shared Secret >EVP_PKEY_CTX *ctx; > >ctx = EVP_PKEY_CTX_new(pkey, NULL); >if (!ctx){ > fprintf( stderr, "Failed to make EVP_PKEY ctx\n" ); >

Re: [openssl-users] EVP_PKEY_set1_EC_KEY seems to not set something that EVP_PKEY_derive needs

2017-03-11 Thread Ethan Rahn
Hey Matt, I'm using openssl-1.0.2j to do this. After a lot of debugging and poking around, I realized that my initial thoughts were not quite correct. Somewhere in trying to come up with an example, I noticed that the problem actually appears to be the buffer I am passing in.. If I use a char

Re: [openssl-users] EVP_PKEY_set1_EC_KEY seems to not set something that EVP_PKEY_derive needs

2017-03-10 Thread Matt Caswell
On 10/03/17 20:58, Ethan Rahn wrote: > Hello Openssl-users, > > I'm trying to write some code that derives the shared secret for 2 > elliptic curve keys ( i.e. does ECDH ) > > I am doing the following to load up both the local and remote EC key ( > code shown for local side ): > > EC_KEY*

[openssl-users] EVP_PKEY_set1_EC_KEY seems to not set something that EVP_PKEY_derive needs

2017-03-10 Thread Ethan Rahn
Hello Openssl-users, I'm trying to write some code that derives the shared secret for 2 elliptic curve keys ( i.e. does ECDH ) I am doing the following to load up both the local and remote EC key ( code shown for local side ): EC_KEY* localEC = EC_KEY_new_by_curve_name( curveName );