> dh_struct = DH_new(); > dh_struct->p = BN_new(); > dh_struct->g = BN_new(); > dh_struct->priv_key = BN_new(); > dh_struct->pub_key = BN_new();
> num_byte = BN_dec2bn(dh_struct->p,str_p); // Here it seems that not execute anything about Something is very wrong in your code. BN_new returns a 'BIGNUM *', so dh_struct->p contains a 'BIGNUM *'. But then you pass dh_struct->p as the first parameter to BN_dec2bn, which takes a 'BIGNUM **'. int BN_dec2bn(BIGNUM **a, const char *str); BIGNUM *BN_new(void); dh_struct->p can't be both a 'BIGNUM *' and a 'BIGNUM **'. In fact, it's a 'BIGNUM *'. So at a minimum, the BN_dec2bn call must be: num_byte = BN_dec2bn(&dh_struct->p, str_p); There could be other mistakes too. This was the most obvious. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]