Public Member Functions | |
dh_shared_secret (EVP_PKEY *pkey) | |
~dh_shared_secret () | |
int | operator() (const DDS::OctetSeq &pub_key, DDS::OctetSeq &dst) |
Private Attributes | |
DH_Handle | keypair |
BIGNUM * | pubkey |
Definition at line 156 of file DiffieHellman.cpp.
OpenDDS::Security::SSL::dh_shared_secret::dh_shared_secret | ( | EVP_PKEY * | pkey | ) | [inline, explicit] |
Definition at line 159 of file DiffieHellman.cpp.
References keypair, and OPENDDS_SSL_LOG_ERR.
00160 : keypair(pkey), pubkey(NULL) 00161 { 00162 if (!keypair) { 00163 OPENDDS_SSL_LOG_ERR("EVP_PKEY_get0_DH failed"); 00164 } 00165 }
OpenDDS::Security::SSL::dh_shared_secret::~dh_shared_secret | ( | ) | [inline] |
int OpenDDS::Security::SSL::dh_shared_secret::operator() | ( | const DDS::OctetSeq & | pub_key, | |
DDS::OctetSeq & | dst | |||
) | [inline] |
Definition at line 169 of file DiffieHellman.cpp.
References keypair, len, OPENDDS_SSL_LOG_ERR, and pubkey.
00170 { 00171 if (!keypair) return 1; 00172 00173 if (NULL == (pubkey = BN_bin2bn(pub_key.get_buffer(), pub_key.length(), 00174 NULL))) { 00175 OPENDDS_SSL_LOG_ERR("BN_bin2bn failed"); 00176 return 1; 00177 } 00178 00179 int len = DH_size(keypair); 00180 dst.length(len); 00181 00182 len = DH_compute_key(dst.get_buffer(), pubkey, keypair); 00183 if (len < 0) { 00184 OPENDDS_SSL_LOG_ERR("DH_compute_key failed"); 00185 dst.length(0u); 00186 return 1; 00187 } 00188 00189 dst.length(len); 00190 return 0; 00191 }
Definition at line 194 of file DiffieHellman.cpp.
Referenced by dh_shared_secret(), and operator()().
BIGNUM* OpenDDS::Security::SSL::dh_shared_secret::pubkey [private] |
Definition at line 195 of file DiffieHellman.cpp.
Referenced by operator()(), and ~dh_shared_secret().