Hi all,

 I have a little pb and after a little search on google I didn't find any
interesting help :-( 

This is my pb: i try to get a session key by DH and when I compute keys I
didn't obtain the same session key.

This is the code :

"

#define PRIME_LEN 64
#define GENERATOR 5

...

DH *dh_mn;
DH *dh_ha;
char *key;
char *key3;
int dh_errors;

    dh_mn = DH_generate_parameters(PRIME_LEN, GENERATOR, NULL, NULL);

    DH_check(dh_mn, &dh_errors);

    DH_generate_key(dh_mn);

    dh_ha = DH_generate_parameters(PRIME_LEN, GENERATOR, NULL, NULL);

    DH_check(dh_ha, &dh_errors);

    DH_generate_key(dh_ha);

    key = malloc(DH_size(dh_ha));
    key3 = malloc(DH_size(dh_mn));
    
    DH_compute_key(key, dh_ha->pub_key, dh_mn);

    DH_compute_key(key3, dh_mn->pub_key, dh_ha);
"

and key is always different from key3...
dh_errors = 0 


thanks

[EMAIL PROTECTED]

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to