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


Public Member Functions | |
| Alert () | |
| Alert (AlertLevel al, AlertDescription ad) | |
| ContentType | get_type () const |
| uint16 | get_length () const |
| void | Process (input_buffer &, SSL &) |
| input_buffer & | set (input_buffer &in) |
| output_buffer & | get (output_buffer &out) const |
Private Member Functions | |
| Alert (const Alert &) | |
| Alert & | operator= (const Alert &) |
Private Attributes | |
| AlertLevel | level_ |
| AlertDescription | description_ |
Friends | |
| input_buffer & | operator>> (input_buffer &, Alert &) |
| output_buffer & | operator<< (output_buffer &, const Alert &) |
Definition at line 103 of file yassl_imp.hpp.
| yaSSL::Alert::Alert | ( | ) | [inline] |
| yaSSL::Alert::Alert | ( | AlertLevel | al, | |
| AlertDescription | ad | |||
| ) |
| yaSSL::Alert::Alert | ( | const Alert & | ) | [private] |
| output_buffer & yaSSL::Alert::get | ( | output_buffer & | out | ) | const [virtual] |
| uint16 yaSSL::Alert::get_length | ( | ) | const [virtual] |
Implements yaSSL::Message.
Definition at line 795 of file yassl_imp.cpp.
References yaSSL::SIZEOF_ENUM.
Referenced by Process().
00796 { 00797 return SIZEOF_ENUM * 2; 00798 }
Here is the caller graph for this function:

| ContentType yaSSL::Alert::get_type | ( | ) | const [virtual] |
Implements yaSSL::Message.
Definition at line 789 of file yassl_imp.cpp.
References yaSSL::alert.
00790 { 00791 return alert; 00792 }
| void yaSSL::Alert::Process | ( | input_buffer & | , | |
| SSL & | ||||
| ) | [virtual] |
Implements yaSSL::Message.
Definition at line 833 of file yassl_imp.cpp.
References yaSSL::alert, yaSSL::AUTO, data, description_, yaSSL::Parameters::encrypt_size_, yaSSL::fatal, mySTL::fill(), yaSSL::input_buffer::get_buffer(), yaSSL::input_buffer::get_current(), yaSSL::Crypto::get_digest(), yaSSL::Digest::get_digestSize(), get_length(), yaSSL::Security::get_parms(), yaSSL::SSL::getCrypto(), yaSSL::SSL::getSecurity(), yaSSL::handShakeNotReady, yaSSL::hmac(), yaSSL::SSL::isTLS(), level_, memcmp(), yaSSL::Parameters::pending_, yaSSL::input_buffer::read(), yaSSL::recordNotReady, yaSSL::SSL::SetError(), yaSSL::SHA_LEN, yaSSL::TLS_hmac(), yaSSL::States::useHandShake(), yaSSL::States::useRecord(), yaSSL::SSL::useStates(), and yaSSL::verify_error.
00834 { 00835 if (ssl.getSecurity().get_parms().pending_ == false) { // encrypted alert 00836 int aSz = get_length(); // alert size already read on input 00837 opaque verify[SHA_LEN]; 00838 const opaque* data = input.get_buffer() + input.get_current() - aSz; 00839 00840 if (ssl.isTLS()) 00841 TLS_hmac(ssl, verify, data, aSz, alert, true); 00842 else 00843 hmac(ssl, verify, data, aSz, alert, true); 00844 00845 // read mac and fill 00846 int digestSz = ssl.getCrypto().get_digest().get_digestSize(); 00847 opaque mac[SHA_LEN]; 00848 input.read(mac, digestSz); 00849 00850 opaque fill; 00851 int padSz = ssl.getSecurity().get_parms().encrypt_size_ - aSz - 00852 digestSz; 00853 for (int i = 0; i < padSz; i++) 00854 fill = input[AUTO]; 00855 00856 // verify 00857 if (memcmp(mac, verify, digestSz)) { 00858 ssl.SetError(verify_error); 00859 return; 00860 } 00861 } 00862 if (level_ == fatal) { 00863 ssl.useStates().useRecord() = recordNotReady; 00864 ssl.useStates().useHandShake() = handShakeNotReady; 00865 ssl.SetError(YasslError(description_)); 00866 } 00867 }
Here is the call graph for this function:

| input_buffer & yaSSL::Alert::set | ( | input_buffer & | in | ) | [virtual] |
| output_buffer& operator<< | ( | output_buffer & | output, | |
| const Alert & | a | |||
| ) | [friend] |
Definition at line 824 of file yassl_imp.cpp.
00825 { 00826 output[AUTO] = a.level_; 00827 output[AUTO] = a.description_; 00828 return output; 00829 }
| input_buffer& operator>> | ( | input_buffer & | input, | |
| Alert & | a | |||
| ) | [friend] |
Definition at line 814 of file yassl_imp.cpp.
00815 { 00816 a.level_ = AlertLevel(input[AUTO]); 00817 a.description_ = AlertDescription(input[AUTO]); 00818 00819 return input; 00820 }
AlertDescription yaSSL::Alert::description_ [private] |
Definition at line 105 of file yassl_imp.hpp.
Referenced by yaSSL::operator<<(), yaSSL::operator>>(), and Process().
AlertLevel yaSSL::Alert::level_ [private] |
Definition at line 104 of file yassl_imp.hpp.
Referenced by yaSSL::operator<<(), yaSSL::operator>>(), and Process().
1.4.7

