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


Public Member Functions | |
| CertificateRequest () | |
| ~CertificateRequest () | |
| input_buffer & | set (input_buffer &in) |
| output_buffer & | get (output_buffer &out) const |
| void | Process (input_buffer &, SSL &) |
| HandShakeType | get_type () const |
| void | Build () |
Private Member Functions | |
| CertificateRequest (const CertificateRequest &) | |
| CertificateRequest & | operator= (const CertificateRequest &) |
Private Attributes | |
| ClientCertificateType | certificate_types_ [CERT_TYPES] |
| int | typeTotal_ |
| mySTL::list< DistinguishedName > | certificate_authorities_ |
Friends | |
| input_buffer & | operator>> (input_buffer &, CertificateRequest &) |
| output_buffer & | operator<< (output_buffer &, const CertificateRequest &) |
Definition at line 427 of file yassl_imp.hpp.
| yaSSL::CertificateRequest::CertificateRequest | ( | ) |
Definition at line 1534 of file yassl_imp.cpp.
References certificate_types_, and memset.
01535 : typeTotal_(0) 01536 { 01537 memset(certificate_types_, 0, sizeof(certificate_types_)); 01538 }
| yaSSL::CertificateRequest::~CertificateRequest | ( | ) |
Definition at line 1541 of file yassl_imp.cpp.
References certificate_authorities_, and mySTL::for_each().
01542 { 01543 01544 mySTL::for_each(certificate_authorities_.begin(), 01545 certificate_authorities_.end(), 01546 del_ptr_zero()) ; 01547 }
Here is the call graph for this function:

| yaSSL::CertificateRequest::CertificateRequest | ( | const CertificateRequest & | ) | [private] |
| void yaSSL::CertificateRequest::Build | ( | ) |
Definition at line 1550 of file yassl_imp.cpp.
References yaSSL::c16toa(), certificate_authorities_, certificate_types_, yaSSL::dss_sign, memcpy, yaSSL::MIN_DIS_SIZE, NEW_YS, yaSSL::REQUEST_HEADER, yaSSL::rsa_sign, yaSSL::HandShakeBase::set_length(), yaSSL::SIZEOF_ENUM, and typeTotal_.
Referenced by yaSSL::sendCertificateRequest().
01551 { 01552 certificate_types_[0] = rsa_sign; 01553 certificate_types_[1] = dss_sign; 01554 01555 typeTotal_ = 2; 01556 01557 uint16 authCount = 0; 01558 uint16 authSz = 0; 01559 01560 for (int j = 0; j < authCount; j++) { 01561 int sz = REQUEST_HEADER + MIN_DIS_SIZE; 01562 DistinguishedName dn; 01563 certificate_authorities_.push_back(dn = NEW_YS byte[sz]); 01564 01565 opaque tmp[REQUEST_HEADER]; 01566 c16toa(MIN_DIS_SIZE, tmp); 01567 memcpy(dn, tmp, sizeof(tmp)); 01568 01569 // fill w/ junk for now 01570 memcpy(dn, tmp, MIN_DIS_SIZE); 01571 authSz += sz; 01572 } 01573 01574 set_length(SIZEOF_ENUM + typeTotal_ + REQUEST_HEADER + authSz); 01575 }
Here is the call graph for this function:

Here is the caller graph for this function:

| output_buffer & yaSSL::CertificateRequest::get | ( | output_buffer & | out | ) | const [virtual] |
| HandShakeType yaSSL::CertificateRequest::get_type | ( | ) | const [virtual] |
Implements yaSSL::HandShakeBase.
Definition at line 1664 of file yassl_imp.cpp.
References yaSSL::certificate_request.
01665 { 01666 return certificate_request; 01667 }
| CertificateRequest& yaSSL::CertificateRequest::operator= | ( | const CertificateRequest & | ) | [private] |
| void yaSSL::CertificateRequest::Process | ( | input_buffer & | , | |
| SSL & | ||||
| ) | [virtual] |
Implements yaSSL::HandShakeBase.
Definition at line 1654 of file yassl_imp.cpp.
References yaSSL::CertManager::get_cert(), yaSSL::CertManager::get_privateKey(), yaSSL::CertManager::setSendVerify(), yaSSL::Crypto::use_certManager(), and yaSSL::SSL::useCrypto().
01655 { 01656 CertManager& cm = ssl.useCrypto().use_certManager(); 01657 01658 // make sure user provided cert and key before sending and using 01659 if (cm.get_cert() && cm.get_privateKey()) 01660 cm.setSendVerify(); 01661 }
Here is the call graph for this function:

| input_buffer & yaSSL::CertificateRequest::set | ( | input_buffer & | in | ) | [virtual] |
| output_buffer& operator<< | ( | output_buffer & | output, | |
| const CertificateRequest & | request | |||
| ) | [friend] |
Definition at line 1623 of file yassl_imp.cpp.
01625 { 01626 // types 01627 output[AUTO] = request.typeTotal_; 01628 for (int i = 0; i < request.typeTotal_; i++) 01629 output[AUTO] = request.certificate_types_[i]; 01630 01631 // authorities 01632 opaque tmp[REQUEST_HEADER]; 01633 c16toa(request.get_length() - SIZEOF_ENUM - 01634 request.typeTotal_ - REQUEST_HEADER, tmp); 01635 output.write(tmp, sizeof(tmp)); 01636 01637 mySTL::list<DistinguishedName>::const_iterator first = 01638 request.certificate_authorities_.begin(); 01639 mySTL::list<DistinguishedName>::const_iterator last = 01640 request.certificate_authorities_.end(); 01641 while (first != last) { 01642 uint16 sz; 01643 ato16(*first, sz); 01644 output.write(*first, sz + REQUEST_HEADER); 01645 01646 ++first; 01647 } 01648 01649 return output; 01650 }
| input_buffer& operator>> | ( | input_buffer & | input, | |
| CertificateRequest & | request | |||
| ) | [friend] |
Definition at line 1591 of file yassl_imp.cpp.
01592 { 01593 // types 01594 request.typeTotal_ = input[AUTO]; 01595 for (int i = 0; i < request.typeTotal_; i++) 01596 request.certificate_types_[i] = ClientCertificateType(input[AUTO]); 01597 01598 byte tmp[REQUEST_HEADER]; 01599 input.read(tmp, sizeof(tmp)); 01600 uint16 sz; 01601 ato16(tmp, sz); 01602 01603 // authorities 01604 while (sz) { 01605 uint16 dnSz; 01606 input.read(tmp, sizeof(tmp)); 01607 ato16(tmp, dnSz); 01608 01609 DistinguishedName dn; 01610 request.certificate_authorities_.push_back(dn = NEW_YS 01611 byte[REQUEST_HEADER + dnSz]); 01612 memcpy(dn, tmp, REQUEST_HEADER); 01613 input.read(&dn[REQUEST_HEADER], dnSz); 01614 01615 sz -= dnSz + REQUEST_HEADER; 01616 } 01617 01618 return input; 01619 }
Definition at line 430 of file yassl_imp.hpp.
Referenced by Build(), yaSSL::operator<<(), yaSSL::operator>>(), and ~CertificateRequest().
Definition at line 428 of file yassl_imp.hpp.
Referenced by Build(), CertificateRequest(), yaSSL::operator<<(), and yaSSL::operator>>().
int yaSSL::CertificateRequest::typeTotal_ [private] |
Definition at line 429 of file yassl_imp.hpp.
Referenced by Build(), yaSSL::operator<<(), and yaSSL::operator>>().
1.4.7

