OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME Class Reference

#include <DiffieHellman.h>

Inheritance diagram for OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DH_2048_MODP_256_PRIME ()
 ~DH_2048_MODP_256_PRIME ()
int init ()
int pub_key (DDS::OctetSeq &dst)
int compute_shared_secret (const DDS::OctetSeq &pub_key)
const char * kagree_algo () const

Detailed Description

Definition at line 49 of file DiffieHellman.h.


Constructor & Destructor Documentation

OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::DH_2048_MODP_256_PRIME (  ) 

Definition at line 55 of file DiffieHellman.cpp.

References init().

00055 { init(); }

Here is the call graph for this function:

OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::~DH_2048_MODP_256_PRIME (  ) 

Definition at line 57 of file DiffieHellman.cpp.

00057 {}


Member Function Documentation

int OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::compute_shared_secret ( const DDS::OctetSeq pub_key  )  [virtual]
Returns:
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 198 of file DiffieHellman.cpp.

References OpenDDS::Security::SSL::DHAlgorithm::k_, and OpenDDS::Security::SSL::DHAlgorithm::shared_secret_.

00200   {
00201     dh_shared_secret secret(k_);
00202     return secret(pub_key, shared_secret_);
00203   }

int OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::init ( void   )  [virtual]
Returns:
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 115 of file DiffieHellman.cpp.

References OpenDDS::Security::SSL::DHAlgorithm::k_.

Referenced by DH_2048_MODP_256_PRIME().

00116   {
00117     if (k_) return 0;
00118 
00119     dh_constructor dh;
00120     k_ = dh();
00121 
00122     if (k_) {
00123       return 0;
00124 
00125     } else {
00126       return 1;
00127     }
00128   }

Here is the caller graph for this function:

const char* OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::kagree_algo (  )  const [inline, virtual]

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 70 of file DiffieHellman.h.

00070 { return "DH+MODP-2048-256"; }

int OpenDDS::Security::SSL::DH_2048_MODP_256_PRIME::pub_key ( DDS::OctetSeq dst  )  [virtual]
Returns:
int 0 on success; 1 on failure.

Implements OpenDDS::Security::SSL::DHAlgorithm.

Definition at line 130 of file DiffieHellman.cpp.

References DH_get0_key(), OpenDDS::Security::SSL::DHAlgorithm::k_, and OPENDDS_SSL_LOG_ERR.

00131   {
00132     int result = 1;
00133 
00134     if (k_) {
00135       DH_Handle dh(k_);
00136       if (dh) {
00137         const BIGNUM *pubkey,
00138           *privkey; /* Ignore the privkey but pass it in anyway since nothing
00139                        documents what happens when a NULL gets passed in */
00140         pubkey = privkey = NULL;
00141         DH_get0_key(dh, &pubkey, &privkey);
00142         if (pubkey) {
00143           dst.length(DH_size(dh));
00144           if (0 < BN_bn2bin(pubkey, dst.get_buffer())) {
00145             result = 0;
00146 
00147           } else {
00148             OPENDDS_SSL_LOG_ERR("BN_bn2bin failed");
00149           }
00150         }
00151       }
00152     }
00153     return result;
00154   }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1