#include <yassl_imp.hpp>
Inheritance diagram for yaSSL::ClientDiffieHellmanPublic:


Public Member Functions | |
| ClientDiffieHellmanPublic () | |
| ~ClientDiffieHellmanPublic () | |
| void | build (SSL &) |
| void | read (SSL &, input_buffer &) |
| int | get_length () const |
| opaque * | get_clientKey () const |
| void | alloc (int sz, bool offset=false) |
Private Types | |
| KEY_OFFSET = 2 | |
| enum | { KEY_OFFSET = 2 } |
Private Member Functions | |
| ClientDiffieHellmanPublic (const ClientDiffieHellmanPublic &) | |
| ClientDiffieHellmanPublic & | operator= (const ClientDiffieHellmanPublic &) |
Private Attributes | |
| PublicValueEncoding | public_value_encoding_ |
| int | length_ |
| opaque * | Yc_ |
Definition at line 513 of file yassl_imp.hpp.
anonymous enum [private] |
| yaSSL::ClientDiffieHellmanPublic::ClientDiffieHellmanPublic | ( | ) |
| yaSSL::ClientDiffieHellmanPublic::~ClientDiffieHellmanPublic | ( | ) |
Definition at line 298 of file yassl_imp.cpp.
References Yc_, and yaSSL::ysArrayDelete().
00299 { 00300 ysArrayDelete(Yc_); 00301 }
Here is the call graph for this function:

| yaSSL::ClientDiffieHellmanPublic::ClientDiffieHellmanPublic | ( | const ClientDiffieHellmanPublic & | ) | [private] |
| void yaSSL::ClientDiffieHellmanPublic::alloc | ( | int | sz, | |
| bool | offset = false | |||
| ) |
Definition at line 316 of file yassl_imp.cpp.
References KEY_OFFSET, length_, NEW_YS, and Yc_.
Referenced by build(), and read().
Here is the caller graph for this function:

| void yaSSL::ClientDiffieHellmanPublic::build | ( | SSL & | ) | [virtual] |
Reimplemented from yaSSL::ClientKeyBase.
Definition at line 111 of file yassl_imp.cpp.
References alloc(), yaSSL::c16toa(), yaSSL::DiffieHellman::get_agreedKey(), yaSSL::DiffieHellman::get_agreedKeyLength(), yaSSL::DiffieHellman::get_publicKey(), KEY_OFFSET, yaSSL::DiffieHellman::makeAgreement(), memcpy, yaSSL::SSL::set_preMaster(), yaSSL::Crypto::use_dh(), yaSSL::SSL::useCrypto(), and Yc_.
00112 { 00113 DiffieHellman& dhServer = ssl.useCrypto().use_dh(); 00114 DiffieHellman dhClient(dhServer); 00115 00116 uint keyLength = dhClient.get_agreedKeyLength(); // pub and agree same 00117 00118 alloc(keyLength, true); 00119 dhClient.makeAgreement(dhServer.get_publicKey(), keyLength); 00120 c16toa(keyLength, Yc_); 00121 memcpy(Yc_ + KEY_OFFSET, dhClient.get_publicKey(), keyLength); 00122 00123 // because of encoding first byte might be zero, don't use it for preMaster 00124 if (*dhClient.get_agreedKey() == 0) 00125 ssl.set_preMaster(dhClient.get_agreedKey() + 1, keyLength - 1); 00126 else 00127 ssl.set_preMaster(dhClient.get_agreedKey(), keyLength); 00128 }
Here is the call graph for this function:

| opaque * yaSSL::ClientDiffieHellmanPublic::get_clientKey | ( | ) | const [virtual] |
Reimplemented from yaSSL::ClientKeyBase.
Definition at line 310 of file yassl_imp.cpp.
References Yc_.
00311 { 00312 return Yc_; 00313 }
| int yaSSL::ClientDiffieHellmanPublic::get_length | ( | ) | const [virtual] |
Reimplemented from yaSSL::ClientKeyBase.
Definition at line 304 of file yassl_imp.cpp.
References length_.
00305 { 00306 return length_; 00307 }
| ClientDiffieHellmanPublic& yaSSL::ClientDiffieHellmanPublic::operator= | ( | const ClientDiffieHellmanPublic & | ) | [private] |
| void yaSSL::ClientDiffieHellmanPublic::read | ( | SSL & | , | |
| input_buffer & | ||||
| ) | [virtual] |
Reimplemented from yaSSL::ClientKeyBase.
Definition at line 270 of file yassl_imp.cpp.
References alloc(), yaSSL::ato16(), yaSSL::AUTO, yaSSL::DiffieHellman::get_agreedKey(), yaSSL::DiffieHellman::get_agreedKeyLength(), yaSSL::DiffieHellman::makeAgreement(), yaSSL::SSL::makeMasterSecret(), yaSSL::input_buffer::read(), yaSSL::SSL::set_preMaster(), yaSSL::Crypto::use_dh(), yaSSL::SSL::useCrypto(), and Yc_.
00271 { 00272 DiffieHellman& dh = ssl.useCrypto().use_dh(); 00273 00274 uint16 keyLength; 00275 byte tmp[2]; 00276 tmp[0] = input[AUTO]; 00277 tmp[1] = input[AUTO]; 00278 ato16(tmp, keyLength); 00279 00280 alloc(keyLength); 00281 input.read(Yc_, keyLength); 00282 dh.makeAgreement(Yc_, keyLength); 00283 00284 // because of encoding, first byte might be 0, don't use for preMaster 00285 if (*dh.get_agreedKey() == 0) 00286 ssl.set_preMaster(dh.get_agreedKey() + 1, dh.get_agreedKeyLength() - 1); 00287 else 00288 ssl.set_preMaster(dh.get_agreedKey(), dh.get_agreedKeyLength()); 00289 ssl.makeMasterSecret(); 00290 }
Here is the call graph for this function:

int yaSSL::ClientDiffieHellmanPublic::length_ [private] |
Definition at line 514 of file yassl_imp.hpp.
opaque* yaSSL::ClientDiffieHellmanPublic::Yc_ [private] |
Definition at line 516 of file yassl_imp.hpp.
Referenced by alloc(), build(), get_clientKey(), read(), and ~ClientDiffieHellmanPublic().
1.4.7

