The world's most popular open source database
| typedef unsigned char yaSSL::byte |
Definition at line 48 of file buffer.hpp.
| typedef unsigned int yaSSL::uint |
Definition at line 49 of file buffer.hpp.
| typedef unsigned char yaSSL::opaque |
Definition at line 49 of file cert_wrapper.hpp.
| typedef unsigned int yaSSL::uint |
| typedef unsigned int yaSSL::uint |
Definition at line 52 of file socket_wrapper.hpp.
| typedef int yaSSL::socket_t |
Definition at line 57 of file socket_wrapper.hpp.
| typedef unsigned char yaSSL::byte |
Definition at line 67 of file socket_wrapper.hpp.
| typedef double yaSSL::timer_d |
| typedef unsigned int yaSSL::uint |
| typedef int yaSSL::SOCKET_T |
| typedef Factory<Message> yaSSL::MessageFactory |
Definition at line 694 of file yassl_imp.hpp.
| typedef Factory<HandShakeBase> yaSSL::HandShakeFactory |
Definition at line 699 of file yassl_imp.hpp.
| typedef Factory<ServerKeyBase> yaSSL::ServerKeyFactory |
Definition at line 704 of file yassl_imp.hpp.
| typedef Factory<ClientKeyBase> yaSSL::ClientKeyFactory |
Definition at line 709 of file yassl_imp.hpp.
| typedef unsigned char yaSSL::uint8 |
Definition at line 113 of file yassl_types.hpp.
| typedef unsigned short yaSSL::uint16 |
Definition at line 114 of file yassl_types.hpp.
| typedef unsigned int yaSSL::uint32 |
Definition at line 115 of file yassl_types.hpp.
| typedef uint8 yaSSL::uint24[3] |
Definition at line 116 of file yassl_types.hpp.
| typedef uint32 yaSSL::uint64[2] |
Definition at line 117 of file yassl_types.hpp.
| typedef uint8 yaSSL::opaque |
Definition at line 119 of file yassl_types.hpp.
| typedef opaque yaSSL::byte |
Definition at line 120 of file yassl_types.hpp.
| typedef unsigned int yaSSL::uint |
Definition at line 122 of file yassl_types.hpp.
| typedef uint8 yaSSL::Cipher |
Definition at line 180 of file yassl_types.hpp.
| typedef opaque yaSSL::Random[RAN_LEN] |
Definition at line 182 of file yassl_types.hpp.
| typedef opaque* yaSSL::DistinguishedName |
Definition at line 184 of file yassl_types.hpp.
| typedef bool yaSSL::IsExportable |
Definition at line 186 of file yassl_types.hpp.
| typedef Mutex::Lock yaSSL::Lock |
Definition at line 1422 of file yassl_int.cpp.
| enum yaSSL::BufferOutput |
| enum yaSSL::YasslError |
Definition at line 38 of file yassl_error.hpp.
00038 { 00039 no_error = 0, 00040 00041 // 10 - 47 from AlertDescription, 0 also close_notify 00042 00043 range_error = 101, 00044 realloc_error = 102, 00045 factory_error = 103, 00046 unknown_cipher = 104, 00047 prefix_error = 105, 00048 record_layer = 106, 00049 handshake_layer = 107, 00050 out_of_order = 108, 00051 bad_input = 109, 00052 match_error = 110, 00053 no_key_file = 111, 00054 verify_error = 112, 00055 send_error = 113, 00056 receive_error = 114, 00057 certificate_error = 115 00058 00059 // 1000+ from TaoCrypt error.hpp 00060 00061 };
| enum yaSSL::Library |
| anonymous enum |
Definition at line 48 of file yassl_int.hpp.
00048 { 00049 recordNotReady = 0, // fatal error, no more processing 00050 recordReady 00051 };
Definition at line 55 of file yassl_int.hpp.
00055 { 00056 handShakeNotReady = 0, // fatal error, no more processing 00057 preHandshake, // initial state 00058 inHandshake, // handshake started 00059 handShakeReady // handshake done 00060 };
| enum yaSSL::ClientState |
| serverNull | |
| serverHelloComplete | |
| serverCertComplete | |
| serverKeyExchangeComplete | |
| serverHelloDoneComplete | |
| serverFinishedComplete |
Definition at line 64 of file yassl_int.hpp.
00064 { 00065 serverNull = 0, 00066 serverHelloComplete, 00067 serverCertComplete, 00068 serverKeyExchangeComplete, 00069 serverHelloDoneComplete, 00070 serverFinishedComplete 00071 };
| enum yaSSL::ServerState |
Definition at line 75 of file yassl_int.hpp.
00075 { 00076 clientNull = 0, 00077 clientHelloComplete, 00078 clientKeyExchangeComplete, 00079 clientFinishedComplete 00080 };
| enum yaSSL::StatsField |
| Accept | |
| Connect | |
| AcceptGood | |
| ConnectGood | |
| AcceptRenegotiate | |
| ConnectRenegotiate | |
| Hits | |
| CbHits | |
| CacheFull | |
| Misses | |
| Timeouts | |
| Number | |
| GetCacheSize | |
| VerifyMode | |
| VerifyDepth |
Definition at line 296 of file yassl_int.hpp.
00296 { 00297 Accept, Connect, AcceptGood, ConnectGood, AcceptRenegotiate, 00298 ConnectRenegotiate, Hits, CbHits, CacheFull, Misses, Timeouts, Number, 00299 GetCacheSize, VerifyMode, VerifyDepth 00300 };
| enum yaSSL::CipherType |
| enum yaSSL::CipherChoice |
| enum yaSSL::ConnectionEnd |
| enum yaSSL::AlertLevel |
| enum yaSSL::ContentType |
Definition at line 204 of file yassl_types.hpp.
00204 { 00205 no_type = 0, 00206 change_cipher_spec = 20, 00207 alert = 21, 00208 handshake = 22, 00209 application_data = 23 00210 };
| enum yaSSL::HandShakeType |
| no_shake | |
| hello_request | |
| client_hello | |
| server_hello | |
| certificate | |
| server_key_exchange | |
| certificate_request | |
| server_hello_done | |
| certificate_verify | |
| client_key_exchange | |
| finished |
Definition at line 214 of file yassl_types.hpp.
00214 { 00215 no_shake = -1, 00216 hello_request = 0, 00217 client_hello = 1, 00218 server_hello = 2, 00219 certificate = 11, 00220 server_key_exchange = 12, 00221 certificate_request = 13, 00222 server_hello_done = 14, 00223 certificate_verify = 15, 00224 client_key_exchange = 16, 00225 finished = 20 00226 };
Definition at line 230 of file yassl_types.hpp.
00230 { 00231 close_notify = 0, 00232 unexpected_message = 10, 00233 bad_record_mac = 20, 00234 decompression_failure = 30, 00235 handshake_failure = 40, 00236 no_certificate = 41, 00237 bad_certificate = 42, 00238 unsupported_certificate = 43, 00239 certificate_revoked = 44, 00240 certificate_expired = 45, 00241 certificate_unknown = 46, 00242 illegal_parameter = 47 00243 };
Definition at line 247 of file yassl_types.hpp.
00247 { 00248 no_kea = 0, 00249 rsa_kea, 00250 diffie_hellman_kea, 00251 fortezza_kea 00252 };
Definition at line 256 of file yassl_types.hpp.
00256 { 00257 anonymous_sa_algo = 0, 00258 rsa_sa_algo, 00259 dsa_sa_algo 00260 };
| rsa_sign | |
| dss_sign | |
| rsa_fixed_dh | |
| dss_fixed_dh | |
| rsa_ephemeral_dh | |
| dss_ephemeral_dh | |
| fortezza_kea_cert |
Definition at line 264 of file yassl_types.hpp.
00264 { 00265 rsa_sign = 1, 00266 dss_sign = 2, 00267 rsa_fixed_dh = 3, 00268 dss_fixed_dh = 4, 00269 rsa_ephemeral_dh = 5, 00270 dss_ephemeral_dh = 6, 00271 fortezza_kea_cert = 20 00272 };
Definition at line 276 of file yassl_types.hpp.
00276 { 00277 cipher_null, 00278 rc4, 00279 rc2, 00280 des, 00281 triple_des, // leading 3 (3des) not valid identifier 00282 des40, 00283 idea, 00284 aes 00285 };
| enum yaSSL::MACAlgorithm |
| enum yaSSL::CertType |
| void yaSSL::checked_delete | ( | T * | p | ) | [inline] |
Definition at line 186 of file buffer.hpp.
References ysDelete().
Referenced by yaSSL::del_ptr_zero::operator()().
00187 { 00188 typedef char complete_type[sizeof(T) ? 1 : -1]; 00189 (void)sizeof(complete_type); 00190 ysDelete(p); 00191 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 911 of file crypto_wrapper.cpp.
References Cert, yaSSL::input_buffer::get_buffer(), line, memcpy, NEW_YS, SEEK_SET, strlen(), x, and ysDelete().
Referenced by read_file().
00912 { 00913 using namespace TaoCrypt; 00914 00915 char header[80]; 00916 char footer[80]; 00917 00918 if (type == Cert) { 00919 strncpy(header, "-----BEGIN CERTIFICATE-----", sizeof(header)); 00920 strncpy(footer, "-----END CERTIFICATE-----", sizeof(footer)); 00921 } else { 00922 strncpy(header, "-----BEGIN RSA PRIVATE KEY-----", sizeof(header)); 00923 strncpy(footer, "-----END RSA PRIVATE KEY-----", sizeof(header)); 00924 } 00925 00926 long begin = -1; 00927 long end = 0; 00928 bool foundEnd = false; 00929 00930 char line[80]; 00931 00932 while(fgets(line, sizeof(line), file)) 00933 if (strncmp(header, line, strlen(header)) == 0) { 00934 begin = ftell(file); 00935 break; 00936 } 00937 00938 while(fgets(line, sizeof(line), file)) 00939 if (strncmp(footer, line, strlen(footer)) == 0) { 00940 foundEnd = true; 00941 break; 00942 } 00943 else 00944 end = ftell(file); 00945 00946 if (begin == -1 || !foundEnd) 00947 return 0; 00948 00949 input_buffer tmp(end - begin); 00950 fseek(file, begin, SEEK_SET); 00951 size_t bytes = fread(tmp.get_buffer(), end - begin, 1, file); 00952 if (bytes != 1) 00953 return 0; 00954 00955 Source der(tmp.get_buffer(), end - begin); 00956 Base64Decoder b64Dec(der); 00957 00958 uint sz = der.size(); 00959 mySTL::auto_ptr<x509> x(NEW_YS x509(sz), ysDelete); 00960 memcpy(x->use_buffer(), der.get_buffer(), sz); 00961 00962 return x.release(); 00963 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendClientHello | ( | SSL & | ) |
Definition at line 764 of file handshake.cpp.
References buildClientHello(), buildHeaders(), buildOutput(), client_end, yaSSL::output_buffer::get_buffer(), yaSSL::Security::get_connection(), yaSSL::output_buffer::get_size(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), hashHandShake(), yaSSL::SSL::Send(), serverNull, yaSSL::SSL::set_random(), yaSSL::SSL::verifyState(), and yaSSL::Connection::version_.
Referenced by SSL_connect().
00765 { 00766 ssl.verifyState(serverNull); 00767 if (ssl.GetError()) return; 00768 00769 ClientHello ch(ssl.getSecurity().get_connection().version_); 00770 RecordLayerHeader rlHeader; 00771 HandShakeHeader hsHeader; 00772 output_buffer out; 00773 00774 buildClientHello(ssl, ch); 00775 ssl.set_random(ch.get_random(), client_end); 00776 buildHeaders(ssl, hsHeader, rlHeader, ch); 00777 buildOutput(out, rlHeader, hsHeader, ch); 00778 hashHandShake(ssl, out); 00779 00780 ssl.Send(out.get_buffer(), out.get_size()); 00781 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendServerHello | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 947 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, buildHeaders(), buildOutput(), buildServerHello(), clientHelloComplete, clientKeyExchangeComplete, mySTL::auto_ptr< T >::get(), yaSSL::Security::get_connection(), yaSSL::Security::get_resuming(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), server_end, yaSSL::SSL::set_random(), yaSSL::SSL::verifyState(), yaSSL::Connection::version_, and ysDelete().
Referenced by SSL_accept().
00948 { 00949 if (ssl.getSecurity().get_resuming()) 00950 ssl.verifyState(clientKeyExchangeComplete); 00951 else 00952 ssl.verifyState(clientHelloComplete); 00953 if (ssl.GetError()) return; 00954 00955 ServerHello sh(ssl.getSecurity().get_connection().version_); 00956 RecordLayerHeader rlHeader; 00957 HandShakeHeader hsHeader; 00958 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00959 00960 buildServerHello(ssl, sh); 00961 ssl.set_random(sh.get_random(), server_end); 00962 buildHeaders(ssl, hsHeader, rlHeader, sh); 00963 buildOutput(*out.get(), rlHeader, hsHeader, sh); 00964 hashHandShake(ssl, *out.get()); 00965 00966 if (buffer == buffered) 00967 ssl.addBuffer(out.release()); 00968 else 00969 ssl.Send(out->get_buffer(), out->get_size()); 00970 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendServerHelloDone | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 974 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, buildHeaders(), buildOutput(), mySTL::auto_ptr< T >::get(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), and ysDelete().
Referenced by SSL_accept().
00975 { 00976 if (ssl.GetError()) return; 00977 00978 ServerHelloDone shd; 00979 RecordLayerHeader rlHeader; 00980 HandShakeHeader hsHeader; 00981 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00982 00983 buildHeaders(ssl, hsHeader, rlHeader, shd); 00984 buildOutput(*out.get(), rlHeader, hsHeader, shd); 00985 hashHandShake(ssl, *out.get()); 00986 00987 if (buffer == buffered) 00988 ssl.addBuffer(out.release()); 00989 else 00990 ssl.Send(out->get_buffer(), out->get_size()); 00991 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendClientKeyExchange | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 785 of file handshake.cpp.
References buffered, yaSSL::ClientKeyExchange::build(), buildHeaders(), buildOutput(), mySTL::auto_ptr< T >::get(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), serverHelloDoneComplete, yaSSL::SSL::verifyState(), and ysDelete().
Referenced by SSL_connect().
00786 { 00787 ssl.verifyState(serverHelloDoneComplete); 00788 if (ssl.GetError()) return; 00789 00790 ClientKeyExchange ck(ssl); 00791 ck.build(ssl); 00792 ssl.makeMasterSecret(); 00793 00794 RecordLayerHeader rlHeader; 00795 HandShakeHeader hsHeader; 00796 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00797 buildHeaders(ssl, hsHeader, rlHeader, ck); 00798 buildOutput(*out.get(), rlHeader, hsHeader, ck); 00799 hashHandShake(ssl, *out.get()); 00800 00801 if (buffer == buffered) 00802 ssl.addBuffer(out.release()); 00803 else 00804 ssl.Send(out->get_buffer(), out->get_size()); 00805 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendServerKeyExchange | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 809 of file handshake.cpp.
References buffered, yaSSL::ServerKeyExchange::build(), buildHeaders(), buildOutput(), mySTL::auto_ptr< T >::get(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), and ysDelete().
Referenced by SSL_accept().
00810 { 00811 if (ssl.GetError()) return; 00812 ServerKeyExchange sk(ssl); 00813 sk.build(ssl); 00814 00815 RecordLayerHeader rlHeader; 00816 HandShakeHeader hsHeader; 00817 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00818 buildHeaders(ssl, hsHeader, rlHeader, sk); 00819 buildOutput(*out.get(), rlHeader, hsHeader, sk); 00820 hashHandShake(ssl, *out.get()); 00821 00822 if (buffer == buffered) 00823 ssl.addBuffer(out.release()); 00824 else 00825 ssl.Send(out->get_buffer(), out->get_size()); 00826 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendChangeCipher | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 830 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, buildHeader(), buildOutput(), clientFinishedComplete, clientKeyExchangeComplete, yaSSL::Parameters::entity_, mySTL::auto_ptr< T >::get(), yaSSL::Security::get_parms(), yaSSL::Security::get_resuming(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), server_end, yaSSL::SSL::verifyState(), and ysDelete().
Referenced by SSL_accept(), and SSL_connect().
00831 { 00832 if (ssl.getSecurity().get_parms().entity_ == server_end) 00833 if (ssl.getSecurity().get_resuming()) 00834 ssl.verifyState(clientKeyExchangeComplete); 00835 else 00836 ssl.verifyState(clientFinishedComplete); 00837 if (ssl.GetError()) return; 00838 00839 ChangeCipherSpec ccs; 00840 RecordLayerHeader rlHeader; 00841 buildHeader(ssl, rlHeader, ccs); 00842 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00843 buildOutput(*out.get(), rlHeader, ccs); 00844 00845 if (buffer == buffered) 00846 ssl.addBuffer(out.release()); 00847 else 00848 ssl.Send(out->get_buffer(), out->get_size()); 00849 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendFinished | ( | SSL & | , | |
| ConnectionEnd | , | |||
| BufferOutput | = buffered | |||
| ) |
Definition at line 853 of file handshake.cpp.
References yaSSL::Sessions::add(), yaSSL::SSL::addBuffer(), buffered, buildFinished(), cipherFinished(), yaSSL::Connection::CleanMaster(), client, client_end, mySTL::auto_ptr< T >::get(), yaSSL::Security::get_resuming(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), GetSessions(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), server, server_end, yaSSL::Security::use_connection(), yaSSL::sslHashes::use_verify(), yaSSL::SSL::useHashes(), yaSSL::SSL::useSecurity(), and ysDelete().
Referenced by SSL_accept(), and SSL_connect().
00854 { 00855 if (ssl.GetError()) return; 00856 00857 Finished fin; 00858 buildFinished(ssl, fin, side == client_end ? client : server); 00859 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 00860 cipherFinished(ssl, fin, *out.get()); // hashes handshake 00861 00862 if (ssl.getSecurity().get_resuming()) { 00863 if (side == server_end) 00864 buildFinished(ssl, ssl.useHashes().use_verify(), client); // client 00865 } 00866 else { 00867 GetSessions().add(ssl); // store session 00868 if (side == client_end) 00869 buildFinished(ssl, ssl.useHashes().use_verify(), server); // server 00870 } 00871 ssl.useSecurity().use_connection().CleanMaster(); 00872 00873 if (buffer == buffered) 00874 ssl.addBuffer(out.release()); 00875 else 00876 ssl.Send(out->get_buffer(), out->get_size()); 00877 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendCertificate | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 995 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, buildHeaders(), buildOutput(), cert, mySTL::auto_ptr< T >::get(), yaSSL::CertManager::get_cert(), yaSSL::Crypto::get_certManager(), yaSSL::SSL::getCrypto(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), and ysDelete().
Referenced by SSL_accept(), and SSL_connect().
00996 { 00997 if (ssl.GetError()) return; 00998 00999 Certificate cert(ssl.getCrypto().get_certManager().get_cert()); 01000 RecordLayerHeader rlHeader; 01001 HandShakeHeader hsHeader; 01002 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 01003 01004 buildHeaders(ssl, hsHeader, rlHeader, cert); 01005 buildOutput(*out.get(), rlHeader, hsHeader, cert); 01006 hashHandShake(ssl, *out.get()); 01007 01008 if (buffer == buffered) 01009 ssl.addBuffer(out.release()); 01010 else 01011 ssl.Send(out->get_buffer(), out->get_size()); 01012 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendCertificateRequest | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 1016 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, yaSSL::CertificateRequest::Build(), buildHeaders(), buildOutput(), mySTL::auto_ptr< T >::get(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), and ysDelete().
Referenced by SSL_accept().
01017 { 01018 if (ssl.GetError()) return; 01019 01020 CertificateRequest request; 01021 request.Build(); 01022 RecordLayerHeader rlHeader; 01023 HandShakeHeader hsHeader; 01024 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 01025 01026 buildHeaders(ssl, hsHeader, rlHeader, request); 01027 buildOutput(*out.get(), rlHeader, hsHeader, request); 01028 hashHandShake(ssl, *out.get()); 01029 01030 if (buffer == buffered) 01031 ssl.addBuffer(out.release()); 01032 else 01033 ssl.Send(out->get_buffer(), out->get_size()); 01034 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::sendCertificateVerify | ( | SSL & | , | |
| BufferOutput | = buffered | |||
| ) |
Definition at line 1038 of file handshake.cpp.
References yaSSL::SSL::addBuffer(), buffered, yaSSL::CertificateVerify::Build(), buildHeaders(), buildOutput(), mySTL::auto_ptr< T >::get(), yaSSL::SSL::GetError(), hashHandShake(), NEW_YS, mySTL::auto_ptr< T >::release(), yaSSL::SSL::Send(), and ysDelete().
Referenced by SSL_connect().
01039 { 01040 if (ssl.GetError()) return; 01041 01042 CertificateVerify verify; 01043 verify.Build(ssl); 01044 RecordLayerHeader rlHeader; 01045 HandShakeHeader hsHeader; 01046 mySTL::auto_ptr<output_buffer> out(NEW_YS output_buffer, ysDelete); 01047 01048 buildHeaders(ssl, hsHeader, rlHeader, verify); 01049 buildOutput(*out.get(), rlHeader, hsHeader, verify); 01050 hashHandShake(ssl, *out.get()); 01051 01052 if (buffer == buffered) 01053 ssl.addBuffer(out.release()); 01054 else 01055 ssl.Send(out->get_buffer(), out->get_size()); 01056 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::sendData | ( | SSL & | , | |
| const void * | , | |||
| int | ||||
| ) |
Definition at line 881 of file handshake.cpp.
References buildMessage(), data, yaSSL::output_buffer::get_buffer(), yaSSL::output_buffer::get_size(), yaSSL::SSL::GetError(), MAX_RECORD_SIZE, min, no_error, yaSSL::SSL::Send(), yaSSL::SSL::SetError(), yaSSL::Log::ShowData(), SSL_ERROR_WANT_READ, yaSSL::SSL::useLog(), and yaSSL::SSL::verfiyHandShakeComplete().
Referenced by SSL_write(), yaSSL::Server::Write(), and yaSSL::Client::Write().
00882 { 00883 if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) 00884 ssl.SetError(no_error); 00885 00886 ssl.verfiyHandShakeComplete(); 00887 if (ssl.GetError()) return -1; 00888 int sent = 0; 00889 00890 for (;;) { 00891 int len = min(sz - sent, MAX_RECORD_SIZE); 00892 output_buffer out; 00893 const Data data(len, static_cast<const opaque*>(buffer) + sent); 00894 00895 buildMessage(ssl, out, data); 00896 ssl.Send(out.get_buffer(), out.get_size()); 00897 00898 if (ssl.GetError()) return -1; 00899 sent += len; 00900 if (sent == sz) break; 00901 } 00902 ssl.useLog().ShowData(sent, true); 00903 return sent; 00904 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::sendAlert | ( | SSL & | ssl, | |
| const Alert & | alert | |||
| ) |
Definition at line 908 of file handshake.cpp.
References alert, buildAlert(), yaSSL::output_buffer::get_buffer(), yaSSL::output_buffer::get_size(), and yaSSL::SSL::Send().
Referenced by SSL_shutdown().
00909 { 00910 output_buffer out; 00911 buildAlert(ssl, out, alert); 00912 ssl.Send(out.get_buffer(), out.get_size()); 00913 00914 return alert.get_length(); 00915 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 919 of file handshake.cpp.
References yaSSL::SSL::bufferedData(), data, yaSSL::SSL::fillData(), yaSSL::SSL::GetError(), yaSSL::SSL::getSocket(), no_error, yaSSL::SSL::PeekData(), processReply(), yaSSL::SSL::SetError(), yaSSL::Log::ShowData(), SSL_ERROR_WANT_READ, SSL_WOULD_BLOCK, yaSSL::SSL::useLog(), yaSSL::SSL::verfiyHandShakeComplete(), and yaSSL::Socket::WouldBlock().
Referenced by yaSSL::Server::Read(), yaSSL::Client::Read(), SSL_peek(), and SSL_read().
00920 { 00921 if (ssl.GetError() == YasslError(SSL_ERROR_WANT_READ)) 00922 ssl.SetError(no_error); 00923 00924 ssl.verfiyHandShakeComplete(); 00925 if (ssl.GetError()) return -1; 00926 00927 if (!ssl.bufferedData()) 00928 processReply(ssl); 00929 00930 if (peek) 00931 ssl.PeekData(data); 00932 else 00933 ssl.fillData(data); 00934 00935 ssl.useLog().ShowData(data.get_length()); 00936 if (ssl.GetError()) return -1; 00937 00938 if (data.get_length() == 0 && ssl.getSocket().WouldBlock()) { 00939 ssl.SetError(YasslError(SSL_ERROR_WANT_READ)); 00940 return SSL_WOULD_BLOCK; 00941 } 00942 return data.get_length(); 00943 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::processReply | ( | SSL & | ) |
Definition at line 747 of file handshake.cpp.
References buffered, DoProcessReply(), yaSSL::SSL::GetError(), and ysDelete().
Referenced by receiveData(), SSL_accept(), and SSL_connect().
00748 { 00749 if (ssl.GetError()) return; 00750 mySTL::auto_ptr<input_buffer> buffered(ysDelete); 00751 00752 for (;;) { 00753 mySTL::auto_ptr<input_buffer> tmp(DoProcessReply(ssl, buffered)); 00754 if (tmp.get()) // had only part of a record's data, call again 00755 buffered = tmp; 00756 else 00757 break; 00758 if (ssl.GetError()) return; 00759 } 00760 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 520 of file handshake.cpp.
References buildFinishedTLS(), buildMD5(), buildSHA(), yaSSL::sslHashes::get_MD5(), yaSSL::sslHashes::get_SHA(), yaSSL::SSL::getHashes(), yaSSL::SSL::isTLS(), md5, sha, yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by yaSSL::ChangeCipherSpec::Process(), and sendFinished().
00521 { 00522 // store current states, building requires get_digest which resets state 00523 MD5 md5(ssl.getHashes().get_MD5()); 00524 SHA sha(ssl.getHashes().get_SHA()); 00525 00526 if (ssl.isTLS()) 00527 buildFinishedTLS(ssl, fin, sender); 00528 else { 00529 buildMD5(ssl, fin, sender); 00530 buildSHA(ssl, fin, sender); 00531 } 00532 00533 // restore 00534 ssl.useHashes().use_MD5() = md5; 00535 ssl.useHashes().use_SHA() = sha; 00536 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::build_certHashes | ( | SSL & | , | |
| Hashes & | ||||
| ) |
Definition at line 641 of file handshake.cpp.
References buildMD5_CertVerify(), buildSHA_CertVerify(), yaSSL::SHA::get_digest(), yaSSL::MD5::get_digest(), yaSSL::sslHashes::get_MD5(), yaSSL::sslHashes::get_SHA(), yaSSL::SSL::getHashes(), yaSSL::SSL::isTLS(), md5, yaSSL::Hashes::md5_, sha, yaSSL::Hashes::sha_, yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by yaSSL::CertificateVerify::Build(), and yaSSL::ClientKeyExchange::Process().
00642 { 00643 // store current states, building requires get_digest which resets state 00644 MD5 md5(ssl.getHashes().get_MD5()); 00645 SHA sha(ssl.getHashes().get_SHA()); 00646 00647 if (ssl.isTLS()) { 00648 ssl.useHashes().use_MD5().get_digest(hashes.md5_); 00649 ssl.useHashes().use_SHA().get_digest(hashes.sha_); 00650 } 00651 else { 00652 buildMD5_CertVerify(ssl, hashes.md5_); 00653 buildSHA_CertVerify(ssl, hashes.sha_); 00654 } 00655 00656 // restore 00657 ssl.useHashes().use_MD5() = md5; 00658 ssl.useHashes().use_SHA() = sha; 00659 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 543 of file handshake.cpp.
References c16toa(), c32toa(), yaSSL::Digest::get_digest(), yaSSL::Digest::get_digestSize(), yaSSL::SSL::get_macSecret(), yaSSL::Digest::get_padSize(), yaSSL::SSL::get_SEQIncrement(), LENGTH_SZ, memcpy, PAD1, PAD2, PAD_MD5, SEQ_SZ, SHA_LEN, SIZEOF_ENUM, yaSSL::Digest::update(), yaSSL::Crypto::use_digest(), and yaSSL::SSL::useCrypto().
Referenced by buildMessage(), cipherFinished(), TaoCrypt::PBKDF2_HMAC< T >::DeriveKey(), p_hash(), yaSSL::Finished::Process(), yaSSL::Data::Process(), yaSSL::Alert::Process(), and TLS_hmac().
00545 { 00546 Digest& mac = ssl.useCrypto().use_digest(); 00547 opaque inner[SHA_LEN + PAD_MD5 + SEQ_SZ + SIZEOF_ENUM + LENGTH_SZ]; 00548 opaque outer[SHA_LEN + PAD_MD5 + SHA_LEN]; 00549 opaque result[SHA_LEN]; // max possible sizes 00550 uint digestSz = mac.get_digestSize(); // actual sizes 00551 uint padSz = mac.get_padSize(); 00552 uint innerSz = digestSz + padSz + SEQ_SZ + SIZEOF_ENUM + LENGTH_SZ; 00553 uint outerSz = digestSz + padSz + digestSz; 00554 00555 // data 00556 const opaque* mac_secret = ssl.get_macSecret(verify); 00557 opaque seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; 00558 opaque length[LENGTH_SZ]; 00559 c16toa(sz, length); 00560 c32toa(ssl.get_SEQIncrement(verify), &seq[sizeof(uint32)]); 00561 00562 // make inner 00563 memcpy(inner, mac_secret, digestSz); 00564 memcpy(&inner[digestSz], PAD1, padSz); 00565 memcpy(&inner[digestSz + padSz], seq, SEQ_SZ); 00566 inner[digestSz + padSz + SEQ_SZ] = content; 00567 memcpy(&inner[digestSz + padSz + SEQ_SZ + SIZEOF_ENUM], length, LENGTH_SZ); 00568 00569 mac.update(inner, innerSz); 00570 mac.get_digest(result, buffer, sz); // append content buffer 00571 00572 // make outer 00573 memcpy(outer, mac_secret, digestSz); 00574 memcpy(&outer[digestSz], PAD2, padSz); 00575 memcpy(&outer[digestSz + padSz], result, digestSz); 00576 00577 mac.get_digest(digest, outer, outerSz); 00578 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 582 of file handshake.cpp.
References c16toa(), c32toa(), yaSSL::Security::get_connection(), yaSSL::SSL::get_macSecret(), yaSSL::Security::get_parms(), yaSSL::SSL::get_SEQIncrement(), yaSSL::SSL::getSecurity(), hmac(), LENGTH_SZ, yaSSL::Parameters::mac_algorithm_, yaSSL::ProtocolVersion::major_, MD5_LEN, memcpy, yaSSL::ProtocolVersion::minor_, NEW_YS, rmd, RMD_LEN, SEQ_SZ, sha, SHA_LEN, SIZEOF_ENUM, yaSSL::Connection::version_, VERSION_SZ, and ysDelete().
Referenced by buildMessage(), cipherFinished(), yaSSL::Finished::Process(), yaSSL::Data::Process(), and yaSSL::Alert::Process().
00584 { 00585 mySTL::auto_ptr<Digest> hmac(ysDelete); 00586 opaque seq[SEQ_SZ] = { 0x00, 0x00, 0x00, 0x00 }; 00587 opaque length[LENGTH_SZ]; 00588 opaque inner[SIZEOF_ENUM + VERSION_SZ + LENGTH_SZ]; // type + version + len 00589 00590 c16toa(sz, length); 00591 c32toa(ssl.get_SEQIncrement(verify), &seq[sizeof(uint32)]); 00592 00593 MACAlgorithm algo = ssl.getSecurity().get_parms().mac_algorithm_; 00594 00595 if (algo == sha) 00596 hmac.reset(NEW_YS HMAC_SHA(ssl.get_macSecret(verify), SHA_LEN)); 00597 else if (algo == rmd) 00598 hmac.reset(NEW_YS HMAC_RMD(ssl.get_macSecret(verify), RMD_LEN)); 00599 else 00600 hmac.reset(NEW_YS HMAC_MD5(ssl.get_macSecret(verify), MD5_LEN)); 00601 00602 hmac->update(seq, SEQ_SZ); // seq_num 00603 inner[0] = content; // type 00604 inner[SIZEOF_ENUM] = ssl.getSecurity().get_connection().version_.major_; 00605 inner[SIZEOF_ENUM + SIZEOF_ENUM] = 00606 ssl.getSecurity().get_connection().version_.minor_; // version 00607 memcpy(&inner[SIZEOF_ENUM + VERSION_SZ], length, LENGTH_SZ); // length 00608 hmac->update(inner, sizeof(inner)); 00609 hmac->get_digest(digest, buffer, sz); // content 00610 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::PRF | ( | byte * | digest, | |
| uint | digLen, | |||
| const byte * | secret, | |||
| uint | secLen, | |||
| const byte * | label, | |||
| uint | labLen, | |||
| const byte * | seed, | |||
| uint | seedLen | |||
| ) |
Definition at line 614 of file handshake.cpp.
References get_xor(), md5, p_hash(), yaSSL::output_buffer::set_current(), sha, and yaSSL::output_buffer::write().
Referenced by buildFinishedTLS(), yaSSL::SSL::deriveTLSKeys(), and yaSSL::SSL::makeTLSMasterSecret().
00616 { 00617 uint half = (secLen + 1) / 2; 00618 00619 output_buffer md5_half(half); 00620 output_buffer sha_half(half); 00621 output_buffer labelSeed(labLen + seedLen); 00622 00623 md5_half.write(secret, half); 00624 sha_half.write(secret + half - secLen % 2, half); 00625 labelSeed.write(label, labLen); 00626 labelSeed.write(seed, seedLen); 00627 00628 output_buffer md5_result(digLen); 00629 output_buffer sha_result(digLen); 00630 00631 p_hash(md5_result, md5_half, labelSeed, md5); 00632 p_hash(sha_result, sha_half, labelSeed, sha); 00633 00634 md5_result.set_current(0); 00635 sha_result.set_current(0); 00636 get_xor(digest, digLen, md5_result, sha_result); 00637 }
Here is the call graph for this function:

Here is the caller graph for this function:

| timer_d yaSSL::timer | ( | ) |
Definition at line 68 of file timer.cpp.
Referenced by com_go(), mark_progress(), and timer_output().
00069 { 00070 struct timeval tv; 00071 gettimeofday(&tv, 0); 00072 00073 return static_cast<double>(tv.tv_sec) 00074 + static_cast<double>(tv.tv_usec) / 1000000; 00075 }
Here is the caller graph for this function:

| uint yaSSL::lowResTimer | ( | ) |
Definition at line 78 of file timer.cpp.
Referenced by yaSSL::Sessions::lookup(), and yaSSL::SSL_SESSION::SSL_SESSION().
Here is the caller graph for this function:

| void yaSSL::SetErrorString | ( | YasslError | , | |
| char * | ||||
| ) |
Definition at line 60 of file yassl_error.cpp.
References TaoCrypt::AFTER_DATE_E, bad_input, TaoCrypt::BEFORE_DATE_E, TaoCrypt::BIT_STR_E, certificate_error, TaoCrypt::CRYPTGEN_E, TaoCrypt::DATE_SZ_E, TaoCrypt::DSA_SZ_E, TaoCrypt::EXPECT_0_E, factory_error, handshake_layer, TaoCrypt::INTEGER_E, match_error, max, MAX_ERROR_SZ, TaoCrypt::NO_ERROR, no_key_file, TaoCrypt::OBJECT_ID_E, TaoCrypt::OCTET_STR_E, TaoCrypt::OPEN_RAN_E, out_of_order, prefix_error, range_error, TaoCrypt::READ_RAN_E, realloc_error, receive_error, record_layer, send_error, TaoCrypt::SEQUENCE_E, TaoCrypt::SET_E, TaoCrypt::SIG_CONFIRM_E, TaoCrypt::SIG_LEN_E, TaoCrypt::SIG_OID_E, TaoCrypt::SIG_OTHER_E, SSL_ERROR_WANT_READ, TaoCrypt::TAG_NULL_E, TaoCrypt::TIME_E, unknown_cipher, TaoCrypt::UNKNOWN_OID_E, TaoCrypt::UNKOWN_HASH_E, TaoCrypt::UNKOWN_SIG_E, verify_error, TaoCrypt::VERSION_E, and TaoCrypt::WINCRYPT_E.
Referenced by ERR_error_string().
00061 { 00062 using namespace TaoCrypt; 00063 const int max = MAX_ERROR_SZ; // shorthand 00064 00065 switch (error) { 00066 00067 // yaSSL proper errors 00068 case range_error : 00069 strncpy(buffer, "buffer index error, out of range", max); 00070 break; 00071 00072 case realloc_error : 00073 strncpy(buffer, "trying to realloc a fixed buffer", max); 00074 break; 00075 00076 case factory_error : 00077 strncpy(buffer, "unknown factory create request", max); 00078 break; 00079 00080 case unknown_cipher : 00081 strncpy(buffer, "trying to use an unknown cipher", max); 00082 break; 00083 00084 case prefix_error : 00085 strncpy(buffer, "bad master secret derivation, prefix too big", max); 00086 break; 00087 00088 case record_layer : 00089 strncpy(buffer, "record layer not ready yet", max); 00090 break; 00091 00092 case handshake_layer : 00093 strncpy(buffer, "handshake layer not ready yet", max); 00094 break; 00095 00096 case out_of_order : 00097 strncpy(buffer, "handshake message received in wrong order", max); 00098 break; 00099 00100 case bad_input : 00101 strncpy(buffer, "bad cipher suite input", max); 00102 break; 00103 00104 case match_error : 00105 strncpy(buffer, "unable to match a supported cipher suite", max); 00106 break; 00107 00108 case no_key_file : 00109 strncpy(buffer, "the server needs a private key file", max); 00110 break; 00111 00112 case verify_error : 00113 strncpy(buffer, "unable to verify peer checksum", max); 00114 break; 00115 00116 case send_error : 00117 strncpy(buffer, "socket layer send error", max); 00118 break; 00119 00120 case receive_error : 00121 strncpy(buffer, "socket layer receive error", max); 00122 break; 00123 00124 case certificate_error : 00125 strncpy(buffer, "unable to proccess cerificate", max); 00126 break; 00127 00128 // openssl errors 00129 case SSL_ERROR_WANT_READ : 00130 strncpy(buffer, "the read operation would block", max); 00131 break; 00132 00133 // TaoCrypt errors 00134 case NO_ERROR : 00135 strncpy(buffer, "not in error state", max); 00136 break; 00137 00138 case WINCRYPT_E : 00139 strncpy(buffer, "bad wincrypt acquire", max); 00140 break; 00141 00142 case CRYPTGEN_E : 00143 strncpy(buffer, "CryptGenRandom error", max); 00144 break; 00145 00146 case OPEN_RAN_E : 00147 strncpy(buffer, "unable to use random device", max); 00148 break; 00149 00150 case READ_RAN_E : 00151 strncpy(buffer, "unable to use random device", max); 00152 break; 00153 00154 case INTEGER_E : 00155 strncpy(buffer, "ASN: bad DER Integer Header", max); 00156 break; 00157 00158 case SEQUENCE_E : 00159 strncpy(buffer, "ASN: bad Sequence Header", max); 00160 break; 00161 00162 case SET_E : 00163 strncpy(buffer, "ASN: bad Set Header", max); 00164 break; 00165 00166 case VERSION_E : 00167 strncpy(buffer, "ASN: version length not 1", max); 00168 break; 00169 00170 case SIG_OID_E : 00171 strncpy(buffer, "ASN: signature OID mismatch", max); 00172 break; 00173 00174 case BIT_STR_E : 00175 strncpy(buffer, "ASN: bad BitString Header", max); 00176 break; 00177 00178 case UNKNOWN_OID_E : 00179 strncpy(buffer, "ASN: unknown key OID type", max); 00180 break; 00181 00182 case OBJECT_ID_E : 00183 strncpy(buffer, "ASN: bad Ojbect ID Header", max); 00184 break; 00185 00186 case TAG_NULL_E : 00187 strncpy(buffer, "ASN: expected TAG NULL", max); 00188 break; 00189 00190 case EXPECT_0_E : 00191 strncpy(buffer, "ASN: expected 0", max); 00192 break; 00193 00194 case OCTET_STR_E : 00195 strncpy(buffer, "ASN: bad Octet String Header", max); 00196 break; 00197 00198 case TIME_E : 00199 strncpy(buffer, "ASN: bad TIME", max); 00200 break; 00201 00202 case DATE_SZ_E : 00203 strncpy(buffer, "ASN: bad Date Size", max); 00204 break; 00205 00206 case SIG_LEN_E : 00207 strncpy(buffer, "ASN: bad Signature Length", max); 00208 break; 00209 00210 case UNKOWN_SIG_E : 00211 strncpy(buffer, "ASN: unknown signature OID", max); 00212 break; 00213 00214 case UNKOWN_HASH_E : 00215 strncpy(buffer, "ASN: unknown hash OID", max); 00216 break; 00217 00218 case DSA_SZ_E : 00219 strncpy(buffer, "ASN: bad DSA r or s size", max); 00220 break; 00221 00222 case BEFORE_DATE_E : 00223 strncpy(buffer, "ASN: before date in the future", max); 00224 break; 00225 00226 case AFTER_DATE_E : 00227 strncpy(buffer, "ASN: after date in the past", max); 00228 break; 00229 00230 case SIG_CONFIRM_E : 00231 strncpy(buffer, "ASN: bad self signature confirmation", max); 00232 break; 00233 00234 case SIG_OTHER_E : 00235 strncpy(buffer, "ASN: bad other signature confirmation", max); 00236 break; 00237 00238 default : 00239 strncpy(buffer, "unknown error number", max); 00240 } 00241 }
Here is the caller graph for this function:

| uint32 yaSSL::c24to32 | ( | const | uint24 | ) |
Definition at line 100 of file yassl_int.cpp.
Referenced by yaSSL::HandShakeHeader::get_length(), yaSSL::Certificate::Process(), and yaSSL::HandShakeHeader::Process().
Here is the caller graph for this function:

Definition at line 83 of file yassl_int.cpp.
Referenced by operator<<(), and yaSSL::HandShakeHeader::set_length().
00084 { 00085 u24[0] = (u32 >> 16) & 0xff; 00086 u24[1] = (u32 >> 8) & 0xff; 00087 u24[2] = u32 & 0xff; 00088 }
Here is the caller graph for this function:

| input_buffer & yaSSL::operator>> | ( | input_buffer & | , | |
| RecordLayerHeader & | ||||
| ) |
Definition at line 542 of file yassl_imp.cpp.
References ato16(), AUTO, yaSSL::RecordLayerHeader::length_, yaSSL::ProtocolVersion::major_, yaSSL::ProtocolVersion::minor_, yaSSL::RecordLayerHeader::type_, and yaSSL::RecordLayerHeader::version_.
00543 { 00544 hdr.type_ = ContentType(input[AUTO]); 00545 hdr.version_.major_ = input[AUTO]; 00546 hdr.version_.minor_ = input[AUTO]; 00547 00548 // length 00549 byte tmp[2]; 00550 tmp[0] = input[AUTO]; 00551 tmp[1] = input[AUTO]; 00552 ato16(tmp, hdr.length_); 00553 00554 return input; 00555 }
Here is the call graph for this function:

| output_buffer & yaSSL::operator<< | ( | output_buffer & | , | |
| const RecordLayerHeader & | ||||
| ) |
Definition at line 559 of file yassl_imp.cpp.
References AUTO, c16toa(), yaSSL::RecordLayerHeader::length_, yaSSL::ProtocolVersion::major_, yaSSL::ProtocolVersion::minor_, yaSSL::RecordLayerHeader::type_, and yaSSL::RecordLayerHeader::version_.
00560 { 00561 output[AUTO] = hdr.type_; 00562 output[AUTO] = hdr.version_.major_; 00563 output[AUTO] = hdr.version_.minor_; 00564 00565 // length 00566 byte tmp[2]; 00567 c16toa(hdr.length_, tmp); 00568 output[AUTO] = tmp[0]; 00569 output[AUTO] = tmp[1]; 00570 00571 return output; 00572 }
Here is the call graph for this function:

| input_buffer & yaSSL::operator>> | ( | input_buffer & | , | |
| Message & | ||||
| ) |
Definition at line 576 of file yassl_imp.cpp.
References yaSSL::Message::set().
Here is the call graph for this function:

| output_buffer & yaSSL::operator<< | ( | output_buffer & | , | |
| const Message & | ||||
| ) |
Definition at line 582 of file yassl_imp.cpp.
References yaSSL::Message::get().
Here is the call graph for this function:

| input_buffer & yaSSL::operator>> | ( | input_buffer & | , | |
| HandShakeBase & | ||||
| ) |
Definition at line 983 of file yassl_imp.cpp.
References yaSSL::HandShakeBase::set().
Here is the call graph for this function:

| output_buffer & yaSSL::operator<< | ( | output_buffer & | , | |
| const HandShakeBase & | ||||
| ) |
Definition at line 990 of file yassl_imp.cpp.
References yaSSL::HandShakeBase::get().
Here is the call graph for this function:

| void yaSSL::InitMessageFactory | ( | MessageFactory & | ) |
Definition at line 2075 of file yassl_imp.cpp.
References alert, application_data, change_cipher_spec, CreateAlert(), CreateCipherSpec(), CreateData(), CreateHandShake(), handshake, yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Register(), and yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Reserve().
02076 { 02077 mf.Reserve(4); 02078 mf.Register(alert, CreateAlert); 02079 mf.Register(change_cipher_spec, CreateCipherSpec); 02080 mf.Register(handshake, CreateHandShake); 02081 mf.Register(application_data, CreateData); 02082 }
Here is the call graph for this function:

| void yaSSL::InitHandShakeFactory | ( | HandShakeFactory & | ) |
Definition at line 2086 of file yassl_imp.cpp.
References certificate, certificate_request, certificate_verify, client_hello, client_key_exchange, CreateCertificate(), CreateCertificateRequest(), CreateCertificateVerify(), CreateClientHello(), CreateClientKeyExchange(), CreateFinished(), CreateHelloRequest(), CreateServerHello(), CreateServerHelloDone(), CreateServerKeyExchange(), finished, hello_request, yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Register(), yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Reserve(), server_hello, server_hello_done, and server_key_exchange.
02087 { 02088 hsf.Reserve(10); 02089 hsf.Register(hello_request, CreateHelloRequest); 02090 hsf.Register(client_hello, CreateClientHello); 02091 hsf.Register(server_hello, CreateServerHello); 02092 hsf.Register(certificate, CreateCertificate); 02093 hsf.Register(server_key_exchange, CreateServerKeyExchange); 02094 hsf.Register(certificate_request, CreateCertificateRequest); 02095 hsf.Register(server_hello_done, CreateServerHelloDone); 02096 hsf.Register(certificate_verify, CreateCertificateVerify); 02097 hsf.Register(client_key_exchange, CreateClientKeyExchange); 02098 hsf.Register(finished, CreateFinished); 02099 }
Here is the call graph for this function:

| void yaSSL::InitServerKeyFactory | ( | ServerKeyFactory & | ) |
Definition at line 2103 of file yassl_imp.cpp.
References CreateDHServerKEA(), CreateFortezzaServerKEA(), CreateRSAServerKEA(), diffie_hellman_kea, fortezza_kea, yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Register(), yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Reserve(), and rsa_kea.
02104 { 02105 skf.Reserve(3); 02106 skf.Register(rsa_kea, CreateRSAServerKEA); 02107 skf.Register(diffie_hellman_kea, CreateDHServerKEA); 02108 skf.Register(fortezza_kea, CreateFortezzaServerKEA); 02109 }
Here is the call graph for this function:

| void yaSSL::InitClientKeyFactory | ( | ClientKeyFactory & | ) |
Definition at line 2113 of file yassl_imp.cpp.
References CreateDHClient(), CreateFortezzaClient(), CreateRSAClient(), diffie_hellman_kea, fortezza_kea, yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Register(), yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::Reserve(), and rsa_kea.
02114 { 02115 ckf.Reserve(3); 02116 ckf.Register(rsa_kea, CreateRSAClient); 02117 ckf.Register(diffie_hellman_kea, CreateDHClient); 02118 ckf.Register(fortezza_kea, CreateFortezzaClient); 02119 }
Here is the call graph for this function:

| Message * yaSSL::CreateHandShake | ( | ) |
Definition at line 2045 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitMessageFactory().
02045 { return NEW_YS HandShakeHeader; }
Here is the caller graph for this function:

| Message * yaSSL::CreateCipherSpec | ( | ) |
Definition at line 2043 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitMessageFactory().
02043 { return NEW_YS ChangeCipherSpec; }
Here is the caller graph for this function:

| Message * yaSSL::CreateAlert | ( | ) |
Definition at line 2044 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitMessageFactory().
02044 { return NEW_YS Alert; }
Here is the caller graph for this function:

| Message * yaSSL::CreateData | ( | ) |
Definition at line 2046 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitMessageFactory().
02046 { return NEW_YS Data; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateCertificate | ( | ) |
Definition at line 2052 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02052 { return NEW_YS Certificate; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateHelloRequest | ( | ) |
Definition at line 2049 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02049 { return NEW_YS HelloRequest; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateClientHello | ( | ) |
Definition at line 2050 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02050 { return NEW_YS ClientHello; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateServerHello | ( | ) |
Definition at line 2051 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02051 { return NEW_YS ServerHello; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateServerKeyExchange | ( | ) |
Definition at line 2053 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02053 { return NEW_YS ServerKeyExchange;}
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateCertificateRequest | ( | ) |
Definition at line 2054 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02054 { return NEW_YS 02055 CertificateRequest; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateServerHelloDone | ( | ) |
Definition at line 2056 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02056 { return NEW_YS ServerHelloDone; }
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateClientKeyExchange | ( | ) |
Definition at line 2058 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02058 { return NEW_YS ClientKeyExchange;}
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateCertificateVerify | ( | ) |
Definition at line 2057 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02057 { return NEW_YS CertificateVerify;}
Here is the caller graph for this function:

| HandShakeBase * yaSSL::CreateFinished | ( | ) |
Definition at line 2059 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitHandShakeFactory().
02059 { return NEW_YS Finished; }
Here is the caller graph for this function:

| ServerKeyBase * yaSSL::CreateRSAServerKEA | ( | ) |
Definition at line 2062 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitServerKeyFactory().
02062 { return NEW_YS RSA_Server; }
Here is the caller graph for this function:

| ServerKeyBase * yaSSL::CreateDHServerKEA | ( | ) |
Definition at line 2063 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitServerKeyFactory().
02063 { return NEW_YS DH_Server; }
Here is the caller graph for this function:

| ServerKeyBase * yaSSL::CreateFortezzaServerKEA | ( | ) |
Definition at line 2064 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitServerKeyFactory().
02064 { return NEW_YS Fortezza_Server; }
Here is the caller graph for this function:

| ClientKeyBase * yaSSL::CreateRSAClient | ( | ) |
Definition at line 2067 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitClientKeyFactory().
02067 { return NEW_YS 02068 EncryptedPreMasterSecret; }
Here is the caller graph for this function:

| ClientKeyBase * yaSSL::CreateDHClient | ( | ) |
Definition at line 2069 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitClientKeyFactory().
02069 { return NEW_YS 02070 ClientDiffieHellmanPublic; }
Here is the caller graph for this function:

| ClientKeyBase * yaSSL::CreateFortezzaClient | ( | ) |
Definition at line 2071 of file yassl_imp.cpp.
References NEW_YS.
Referenced by InitClientKeyFactory().
02071 { return NEW_YS FortezzaKeys; }
Here is the caller graph for this function:

| Sessions & yaSSL::GetSessions | ( | ) |
Definition at line 1403 of file yassl_int.cpp.
References NEW_YS, and sessionsInstance.
Referenced by yaSSL::ClientHello::Process(), sendFinished(), yaSSL::SSL::set_session(), and SSL_get_session().
01404 { 01405 if (!sessionsInstance) 01406 sessionsInstance = NEW_YS Sessions; 01407 return *sessionsInstance; 01408 }
Here is the caller graph for this function:

| sslFactory & yaSSL::GetSSL_Factory | ( | ) |
Definition at line 1413 of file yassl_int.cpp.
References NEW_YS, and sslFactoryInstance.
Referenced by yaSSL::SSL::getFactory().
01414 { 01415 if (!sslFactoryInstance) 01416 sslFactoryInstance = NEW_YS sslFactory; 01417 return *sslFactoryInstance; 01418 }
Here is the caller graph for this function:

| void yaSSL::c24to32 | ( | const | uint24, | |
| uint32 & | ||||
| ) |
Definition at line 113 of file yassl_int.cpp.
Referenced by operator<<(), operator>>(), ProcessOldClientHello(), yaSSL::DH_Server::read(), yaSSL::ClientDiffieHellmanPublic::read(), and yaSSL::EncryptedPreMasterSecret::read().
Here is the caller graph for this function:

Definition at line 130 of file yassl_int.cpp.
Referenced by yaSSL::CertificateVerify::Build(), yaSSL::CertificateRequest::Build(), yaSSL::DH_Server::build(), yaSSL::ClientDiffieHellmanPublic::build(), yaSSL::EncryptedPreMasterSecret::build(), hmac(), operator<<(), and TLS_hmac().
Here is the caller graph for this function:

| void yaSSL::c24toa | ( | const | uint24, | |
| opaque * | ||||
| ) |
Definition at line 147 of file yassl_int.cpp.
Referenced by hmac(), and TLS_hmac().
00148 { 00149 c[0] = (u32 >> 24) & 0xff; 00150 c[1] = (u32 >> 16) & 0xff; 00151 c[2] = (u32 >> 8) & 0xff; 00152 c[3] = u32 & 0xff; 00153 }
Here is the caller graph for this function:

| void yaSSL::ysDelete | ( | T * | ptr | ) |
Definition at line 93 of file yassl_types.hpp.
Referenced by BN_bin2bn(), yaSSL::DH_Server::build(), checked_delete(), DH_free(), DoProcessReply(), yaSSL::SSL::fillData(), yaSSL::SSL::flushBuffer(), p_hash(), PemToDer(), yaSSL::HandShakeHeader::Process(), processReply(), sendCertificate(), sendCertificateRequest(), sendCertificateVerify(), sendChangeCipher(), sendClientKeyExchange(), sendFinished(), sendServerHello(), sendServerHelloDone(), sendServerKeyExchange(), SSL_CTX_free(), SSL_free(), TLS_hmac(), yaSSL_CleanUp(), yaSSL::AES::~AES(), yaSSL::CertManager::~CertManager(), yaSSL::ClientKeyExchange::~ClientKeyExchange(), yaSSL::Crypto::~Crypto(), yaSSL::DES::~DES(), yaSSL::DES_EDE::~DES_EDE(), yaSSL::DiffieHellman::~DiffieHellman(), yaSSL::DSS::~DSS(), yaSSL::HMAC_MD5::~HMAC_MD5(), yaSSL::HMAC_RMD::~HMAC_RMD(), yaSSL::HMAC_SHA::~HMAC_SHA(), yaSSL::Integer::~Integer(), yaSSL::MD5::~MD5(), yaSSL::RandomPool::~RandomPool(), yaSSL::RC4::~RC4(), yaSSL::RMD::~RMD(), yaSSL::RSA::~RSA(), yaSSL::ServerKeyExchange::~ServerKeyExchange(), yaSSL::SHA::~SHA(), and yaSSL::SSL_CTX::~SSL_CTX().
Here is the caller graph for this function:

| void yaSSL::ysArrayDelete | ( | T * | ptr | ) |
Definition at line 99 of file yassl_types.hpp.
Referenced by yaSSL::CertificateVerify::Build(), yaSSL::Connection::CleanPreMaster(), yaSSL::X509_NAME::GetEntry(), yaSSL::CertificateVerify::~CertificateVerify(), yaSSL::ClientDiffieHellmanPublic::~ClientDiffieHellmanPublic(), yaSSL::Connection::~Connection(), yaSSL::DH_Server::~DH_Server(), yaSSL::DiffieHellman::DHImpl::~DHImpl(), yaSSL::EncryptedPreMasterSecret::~EncryptedPreMasterSecret(), yaSSL::input_buffer::~input_buffer(), yaSSL::output_buffer::~output_buffer(), yaSSL::ServerDHParams::~ServerDHParams(), yaSSL::StringHolder::~StringHolder(), yaSSL::x509::~x509(), and yaSSL::X509_NAME::~X509_NAME().
Here is the caller graph for this function:

| void yaSSL::buildClientHello | ( | SSL & | ssl, | |
| ClientHello & | hello, | |||
| CompressionMethod | compression = no_compression | |||
| ) |
Definition at line 44 of file handshake.cpp.
References yaSSL::ClientHello::cipher_suites_, yaSSL::ClientHello::comp_len_, yaSSL::ClientHello::compression_methods_, yaSSL::RandomPool::Fill(), yaSSL::Security::get_parms(), yaSSL::Crypto::get_random(), yaSSL::Security::get_resume(), yaSSL::Security::get_resuming(), yaSSL::SSL::getCrypto(), yaSSL::SSL_SESSION::GetID(), yaSSL::SSL::getSecurity(), ID_LEN, yaSSL::ClientHello::id_len_, memcpy, RAN_LEN, yaSSL::ClientHello::random_, yaSSL::ClientHello::session_id_, yaSSL::HandShakeBase::set_length(), yaSSL::ClientHello::suite_len_, yaSSL::Parameters::suites_, and yaSSL::Parameters::suites_size_.
Referenced by sendClientHello().
00046 { 00047 ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN); 00048 if (ssl.getSecurity().get_resuming()) { 00049 hello.id_len_ = ID_LEN; 00050 memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(), 00051 ID_LEN); 00052 } 00053 else 00054 hello.id_len_ = 0; 00055 hello.suite_len_ = ssl.getSecurity().get_parms().suites_size_; 00056 memcpy(hello.cipher_suites_, ssl.getSecurity().get_parms().suites_, 00057 hello.suite_len_); 00058 hello.comp_len_ = 1; 00059 hello.compression_methods_ = compression; 00060 00061 hello.set_length(sizeof(ProtocolVersion) + 00062 RAN_LEN + 00063 hello.id_len_ + sizeof(hello.id_len_) + 00064 hello.suite_len_ + sizeof(hello.suite_len_) + 00065 hello.comp_len_ + sizeof(hello.comp_len_)); 00066 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::buildServerHello | ( | SSL & | ssl, | |
| ServerHello & | hello | |||
| ) |
Definition at line 70 of file handshake.cpp.
References yaSSL::ServerHello::cipher_suite_, yaSSL::ServerHello::compression_method_, yaSSL::RandomPool::Fill(), yaSSL::Security::get_connection(), yaSSL::Security::get_parms(), yaSSL::Crypto::get_random(), yaSSL::Security::get_resume(), yaSSL::Security::get_resuming(), yaSSL::SSL::getCrypto(), yaSSL::SSL_SESSION::GetID(), yaSSL::SSL::getSecurity(), ID_LEN, yaSSL::ServerHello::id_len_, memcpy, no_compression, RAN_LEN, yaSSL::ServerHello::random_, yaSSL::Connection::server_random_, yaSSL::ServerHello::session_id_, yaSSL::HandShakeBase::set_length(), yaSSL::SSL::set_sessionID(), SIZEOF_ENUM, yaSSL::Parameters::suite_, and SUITE_LEN.
Referenced by sendServerHello().
00071 { 00072 if (ssl.getSecurity().get_resuming()) { 00073 memcpy(hello.random_,ssl.getSecurity().get_connection().server_random_, 00074 RAN_LEN); 00075 memcpy(hello.session_id_, ssl.getSecurity().get_resume().GetID(), 00076 ID_LEN); 00077 } 00078 else { 00079 ssl.getCrypto().get_random().Fill(hello.random_, RAN_LEN); 00080 ssl.getCrypto().get_random().Fill(hello.session_id_, ID_LEN); 00081 } 00082 hello.id_len_ = ID_LEN; 00083 ssl.set_sessionID(hello.session_id_); 00084 00085 hello.cipher_suite_[0] = ssl.getSecurity().get_parms().suite_[0]; 00086 hello.cipher_suite_[1] = ssl.getSecurity().get_parms().suite_[1]; 00087 hello.compression_method_ = no_compression; 00088 00089 hello.set_length(sizeof(ProtocolVersion) + RAN_LEN + ID_LEN + 00090 sizeof(hello.id_len_) + SUITE_LEN + SIZEOF_ENUM); 00091 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 95 of file handshake.cpp.
References buffer, yaSSL::input_buffer::get_buffer(), yaSSL::input_buffer::get_current(), HANDSHAKE_HEADER, yaSSL::SHA::update(), yaSSL::MD5::update(), yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by cipherFinished(), yaSSL::HandShakeHeader::Process(), sendCertificate(), sendCertificateRequest(), sendCertificateVerify(), sendClientHello(), sendClientKeyExchange(), sendServerHello(), sendServerHelloDone(), and sendServerKeyExchange().
00096 { 00097 const opaque* buffer = input.get_buffer() + input.get_current() - 00098 HANDSHAKE_HEADER; 00099 sz += HANDSHAKE_HEADER; 00100 ssl.useHashes().use_MD5().update(buffer, sz); 00101 ssl.useHashes().use_SHA().update(buffer, sz); 00102 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::buildOutput | ( | output_buffer & | buffer, | |
| const RecordLayerHeader & | rlHdr, | |||
| const Message & | msg | |||
| ) | [static] |
Definition at line 109 of file handshake.cpp.
References buffer, yaSSL::RecordLayerHeader::length_, and RECORD_HEADER.
Referenced by buildAlert(), sendCertificate(), sendCertificateRequest(), sendCertificateVerify(), sendChangeCipher(), sendClientHello(), sendClientKeyExchange(), sendServerHello(), sendServerHelloDone(), and sendServerKeyExchange().
00111 { 00112 buffer.allocate(RECORD_HEADER + rlHdr.length_); 00113 buffer << rlHdr << msg; 00114 }
Here is the caller graph for this function:

| void yaSSL::@17::buildOutput | ( | output_buffer & | buffer, | |
| const RecordLayerHeader & | rlHdr, | |||
| const HandShakeHeader & | hsHdr, | |||
| const HandShakeBase & | shake | |||
| ) | [static] |
Definition at line 118 of file handshake.cpp.
References buffer, yaSSL::RecordLayerHeader::length_, and RECORD_HEADER.
00120 { 00121 buffer.allocate(RECORD_HEADER + rlHdr.length_); 00122 buffer << rlHdr << hsHdr << shake; 00123 }
| void yaSSL::@17::buildHeader | ( | SSL & | ssl, | |
| RecordLayerHeader & | rlHeader, | |||
| const Message & | msg | |||
| ) | [static] |
Definition at line 127 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::Message::get_length(), yaSSL::Message::get_type(), yaSSL::SSL::getSecurity(), yaSSL::RecordLayerHeader::length_, yaSSL::ProtocolVersion::major_, yaSSL::ProtocolVersion::minor_, yaSSL::RecordLayerHeader::type_, yaSSL::RecordLayerHeader::version_, and yaSSL::Connection::version_.
Referenced by buildAlert(), buildMessage(), and sendChangeCipher().
00128 { 00129 ProtocolVersion pv = ssl.getSecurity().get_connection().version_; 00130 rlHeader.type_ = msg.get_type(); 00131 rlHeader.version_.major_ = pv.major_; 00132 rlHeader.version_.minor_ = pv.minor_; 00133 rlHeader.length_ = msg.get_length(); 00134 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::buildHeaders | ( | SSL & | ssl, | |
| HandShakeHeader & | hsHeader, | |||
| RecordLayerHeader & | rlHeader, | |||
| const HandShakeBase & | shake | |||
| ) | [static] |
Definition at line 138 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::HandShakeBase::get_length(), yaSSL::HandShakeBase::get_type(), yaSSL::SSL::getSecurity(), handshake, HANDSHAKE_HEADER, yaSSL::RecordLayerHeader::length_, yaSSL::ProtocolVersion::major_, yaSSL::ProtocolVersion::minor_, yaSSL::HandShakeHeader::set_length(), yaSSL::HandShakeHeader::set_type(), yaSSL::RecordLayerHeader::type_, yaSSL::RecordLayerHeader::version_, and yaSSL::Connection::version_.
Referenced by cipherFinished(), sendCertificate(), sendCertificateRequest(), sendCertificateVerify(), sendClientHello(), sendClientKeyExchange(), sendServerHello(), sendServerHelloDone(), and sendServerKeyExchange().
00140 { 00141 int sz = shake.get_length(); 00142 00143 hsHeader.set_type(shake.get_type()); 00144 hsHeader.set_length(sz); 00145 00146 ProtocolVersion pv = ssl.getSecurity().get_connection().version_; 00147 rlHeader.type_ = handshake; 00148 rlHeader.version_.major_ = pv.major_; 00149 rlHeader.version_.minor_ = pv.minor_; 00150 rlHeader.length_ = sz + HANDSHAKE_HEADER; 00151 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::hashHandShake | ( | SSL & | ssl, | |
| const output_buffer & | output | |||
| ) | [static] |
Definition at line 155 of file handshake.cpp.
References buffer, yaSSL::output_buffer::get_buffer(), yaSSL::output_buffer::get_size(), RECORD_HEADER, yaSSL::SHA::update(), yaSSL::MD5::update(), yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
00156 { 00157 uint sz = output.get_size() - RECORD_HEADER; 00158 00159 const opaque* buffer = output.get_buffer() + RECORD_HEADER; 00160 00161 ssl.useHashes().use_MD5().update(buffer, sz); 00162 ssl.useHashes().use_SHA().update(buffer, sz); 00163 }
Here is the call graph for this function:

Definition at line 167 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::MD5::get_digest(), yaSSL::SSL::getSecurity(), yaSSL::Connection::master_secret_, MD5_LEN, memcpy, PAD1, PAD2, PAD_MD5, SECRET_LEN, yaSSL::Finished::set_md5(), SIZEOF_SENDER, yaSSL::sslHashes::use_MD5(), and yaSSL::SSL::useHashes().
Referenced by buildFinished().
00168 { 00169 00170 opaque md5_result[MD5_LEN]; 00171 opaque md5_inner[SIZEOF_SENDER + SECRET_LEN + PAD_MD5]; 00172 opaque md5_outer[SECRET_LEN + PAD_MD5 + MD5_LEN]; 00173 00174 const opaque* master_secret = 00175 ssl.getSecurity().get_connection().master_secret_; 00176 00177 // make md5 inner 00178 memcpy(md5_inner, sender, SIZEOF_SENDER); 00179 memcpy(&md5_inner[SIZEOF_SENDER], master_secret, SECRET_LEN); 00180 memcpy(&md5_inner[SIZEOF_SENDER + SECRET_LEN], PAD1, PAD_MD5); 00181 00182 ssl.useHashes().use_MD5().get_digest(md5_result, md5_inner, 00183 sizeof(md5_inner)); 00184 00185 // make md5 outer 00186 memcpy(md5_outer, master_secret, SECRET_LEN); 00187 memcpy(&md5_outer[SECRET_LEN], PAD2, PAD_MD5); 00188 memcpy(&md5_outer[SECRET_LEN + PAD_MD5], md5_result, MD5_LEN); 00189 00190 ssl.useHashes().use_MD5().get_digest(fin.set_md5(), md5_outer, 00191 sizeof(md5_outer)); 00192 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 196 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::SHA::get_digest(), yaSSL::SSL::getSecurity(), yaSSL::Connection::master_secret_, memcpy, PAD1, PAD2, PAD_SHA, SECRET_LEN, yaSSL::Finished::set_sha(), SHA_LEN, SIZEOF_SENDER, yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by buildFinished().
00197 { 00198 00199 opaque sha_result[SHA_LEN]; 00200 opaque sha_inner[SIZEOF_SENDER + SECRET_LEN + PAD_SHA]; 00201 opaque sha_outer[SECRET_LEN + PAD_SHA + SHA_LEN]; 00202 00203 const opaque* master_secret = 00204 ssl.getSecurity().get_connection().master_secret_; 00205 00206 // make sha inner 00207 memcpy(sha_inner, sender, SIZEOF_SENDER); 00208 memcpy(&sha_inner[SIZEOF_SENDER], master_secret, SECRET_LEN); 00209 memcpy(&sha_inner[SIZEOF_SENDER + SECRET_LEN], PAD1, PAD_SHA); 00210 00211 ssl.useHashes().use_SHA().get_digest(sha_result, sha_inner, 00212 sizeof(sha_inner)); 00213 00214 // make sha outer 00215 memcpy(sha_outer, master_secret, SECRET_LEN); 00216 memcpy(&sha_outer[SECRET_LEN], PAD2, PAD_SHA); 00217 memcpy(&sha_outer[SECRET_LEN + PAD_SHA], sha_result, SHA_LEN); 00218 00219 ssl.useHashes().use_SHA().get_digest(fin.set_sha(), sha_outer, 00220 sizeof(sha_outer)); 00221 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 225 of file handshake.cpp.
References cipher, yaSSL::BulkCipher::decrypt(), yaSSL::Parameters::encrypt_size_, yaSSL::input_buffer::get_buffer(), yaSSL::input_buffer::get_current(), memcpy, plain, yaSSL::Crypto::use_cipher(), yaSSL::Security::use_parms(), yaSSL::SSL::useCrypto(), and yaSSL::SSL::useSecurity().
Referenced by DoProcessReply().
00226 { 00227 input_buffer plain(sz); 00228 opaque* cipher = input.get_buffer() + input.get_current(); 00229 00230 ssl.useCrypto().use_cipher().decrypt(plain.get_buffer(), cipher, sz); 00231 memcpy(cipher, plain.get_buffer(), sz); 00232 ssl.useSecurity().use_parms().encrypt_size_ = sz; 00233 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::cipherFinished | ( | SSL & | ssl, | |
| Finished & | fin, | |||
| output_buffer & | output | |||
| ) | [static] |
Definition at line 237 of file handshake.cpp.
References yaSSL::output_buffer::allocate(), AUTO, block, buildHeaders(), cipher, yaSSL::Parameters::cipher_type_, yaSSL::BulkCipher::encrypt(), FINISHED_SZ, yaSSL::BulkCipher::get_blockSize(), yaSSL::output_buffer::get_buffer(), yaSSL::Crypto::get_cipher(), yaSSL::Crypto::get_digest(), yaSSL::Digest::get_digestSize(), yaSSL::Security::get_parms(), yaSSL::output_buffer::get_size(), yaSSL::SSL::getCrypto(), yaSSL::SSL::getSecurity(), handshake, HANDSHAKE_HEADER, hashHandShake(), hmac(), yaSSL::SSL::isTLS(), yaSSL::RecordLayerHeader::length_, TaoCrypt::pad, RECORD_HEADER, yaSSL::output_buffer::set_current(), SHA_LEN, TLS_FINISHED_SZ, TLS_hmac(), yaSSL::Crypto::use_cipher(), yaSSL::SSL::useCrypto(), and yaSSL::output_buffer::write().
Referenced by sendFinished().
00238 { 00239 uint digestSz = ssl.getCrypto().get_digest().get_digestSize(); 00240 uint finishedSz = ssl.isTLS() ? TLS_FINISHED_SZ : FINISHED_SZ; 00241 uint sz = RECORD_HEADER + HANDSHAKE_HEADER + finishedSz + digestSz; 00242 uint pad = 0; 00243 if (ssl.getSecurity().get_parms().cipher_type_ == block) { 00244 sz += 1; // pad byte 00245 uint blockSz = ssl.getCrypto().get_cipher().get_blockSize(); 00246 pad = (sz - RECORD_HEADER) % blockSz; 00247 pad = blockSz - pad; 00248 sz += pad; 00249 } 00250 00251 RecordLayerHeader rlHeader; 00252 HandShakeHeader hsHeader; 00253 buildHeaders(ssl, hsHeader, rlHeader, fin); 00254 rlHeader.length_ = sz - RECORD_HEADER; // record header includes mac 00255 // and pad, hanshake doesn't 00256 output.allocate(sz); 00257 output << rlHeader << hsHeader << fin; 00258 00259 hashHandShake(ssl, output); 00260 opaque digest[SHA_LEN]; // max size 00261 if (ssl.isTLS()) 00262 TLS_hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, 00263 output.get_size() - RECORD_HEADER, handshake); 00264 else 00265 hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, 00266 output.get_size() - RECORD_HEADER, handshake); 00267 output.write(digest, digestSz); 00268 00269 if (ssl.getSecurity().get_parms().cipher_type_ == block) 00270 for (uint i = 0; i <= pad; i++) output[AUTO] = pad; // pad byte gets 00271 // pad value too 00272 input_buffer cipher(rlHeader.length_); 00273 ssl.useCrypto().use_cipher().encrypt(cipher.get_buffer(), 00274 output.get_buffer() + RECORD_HEADER, output.get_size() - RECORD_HEADER); 00275 output.set_current(RECORD_HEADER); 00276 output.write(cipher.get_buffer(), cipher.get_capacity()); 00277 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::buildMessage | ( | SSL & | ssl, | |
| output_buffer & | output, | |||
| const Message & | msg | |||
| ) | [static] |
Definition at line 281 of file handshake.cpp.
References yaSSL::output_buffer::allocate(), AUTO, block, buildHeader(), cipher, yaSSL::Parameters::cipher_type_, yaSSL::BulkCipher::encrypt(), yaSSL::BulkCipher::get_blockSize(), yaSSL::output_buffer::get_buffer(), yaSSL::Crypto::get_cipher(), yaSSL::Crypto::get_digest(), yaSSL::Digest::get_digestSize(), yaSSL::Message::get_length(), yaSSL::Security::get_parms(), yaSSL::output_buffer::get_size(), yaSSL::SSL::getCrypto(), yaSSL::SSL::getSecurity(), hmac(), yaSSL::SSL::isTLS(), yaSSL::RecordLayerHeader::length_, TaoCrypt::pad, RECORD_HEADER, yaSSL::output_buffer::set_current(), SHA_LEN, TLS_hmac(), yaSSL::Crypto::use_cipher(), yaSSL::SSL::useCrypto(), and yaSSL::output_buffer::write().
Referenced by buildAlert(), and sendData().
00282 { 00283 uint digestSz = ssl.getCrypto().get_digest().get_digestSize(); 00284 uint sz = RECORD_HEADER + msg.get_length() + digestSz; 00285 uint pad = 0; 00286 if (ssl.getSecurity().get_parms().cipher_type_ == block) { 00287 sz += 1; // pad byte 00288 uint blockSz = ssl.getCrypto().get_cipher().get_blockSize(); 00289 pad = (sz - RECORD_HEADER) % blockSz; 00290 pad = blockSz - pad; 00291 sz += pad; 00292 } 00293 00294 RecordLayerHeader rlHeader; 00295 buildHeader(ssl, rlHeader, msg); 00296 rlHeader.length_ = sz - RECORD_HEADER; // record header includes mac 00297 // and pad, hanshake doesn't 00298 output.allocate(sz); 00299 output << rlHeader << msg; 00300 00301 opaque digest[SHA_LEN]; // max size 00302 if (ssl.isTLS()) 00303 TLS_hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, 00304 output.get_size() - RECORD_HEADER, msg.get_type()); 00305 else 00306 hmac(ssl, digest, output.get_buffer() + RECORD_HEADER, 00307 output.get_size() - RECORD_HEADER, msg.get_type()); 00308 output.write(digest, digestSz); 00309 00310 if (ssl.getSecurity().get_parms().cipher_type_ == block) 00311 for (uint i = 0; i <= pad; i++) output[AUTO] = pad; // pad byte gets 00312 // pad value too 00313 input_buffer cipher(rlHeader.length_); 00314 ssl.useCrypto().use_cipher().encrypt(cipher.get_buffer(), 00315 output.get_buffer() + RECORD_HEADER, output.get_size() - RECORD_HEADER); 00316 output.set_current(RECORD_HEADER); 00317 output.write(cipher.get_buffer(), cipher.get_capacity()); 00318 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::buildAlert | ( | SSL & | ssl, | |
| output_buffer & | output, | |||
| const Alert & | alert | |||
| ) | [static] |
Definition at line 322 of file handshake.cpp.
References alert, buildHeader(), buildMessage(), buildOutput(), yaSSL::Security::get_parms(), yaSSL::SSL::getSecurity(), and yaSSL::Parameters::pending_.
Referenced by sendAlert().
00323 { 00324 if (ssl.getSecurity().get_parms().pending_ == false) // encrypted 00325 buildMessage(ssl, output, alert); 00326 else { 00327 RecordLayerHeader rlHeader; 00328 buildHeader(ssl, rlHeader, alert); 00329 buildOutput(output, rlHeader, alert); 00330 } 00331 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 335 of file handshake.cpp.
References client, FINISHED_LABEL_SZ, FINISHED_SZ, yaSSL::Security::get_connection(), yaSSL::SHA::get_digest(), yaSSL::MD5::get_digest(), yaSSL::SSL::getSecurity(), yaSSL::Connection::master_secret_, MD5_LEN, PRF(), SECRET_LEN, yaSSL::HandShakeBase::set_length(), yaSSL::Finished::set_md5(), SIZEOF_SENDER, tls_client, TLS_FINISHED_SZ, tls_server, yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by buildFinished().
00336 { 00337 opaque handshake_hash[FINISHED_SZ]; 00338 00339 ssl.useHashes().use_MD5().get_digest(handshake_hash); 00340 ssl.useHashes().use_SHA().get_digest(&handshake_hash[MD5_LEN]); 00341 00342 const opaque* side; 00343 if ( strncmp((const char*)sender, (const char*)client, SIZEOF_SENDER) == 0) 00344 side = tls_client; 00345 else 00346 side = tls_server; 00347 00348 PRF(fin.set_md5(), TLS_FINISHED_SZ, 00349 ssl.getSecurity().get_connection().master_secret_, SECRET_LEN, 00350 side, FINISHED_LABEL_SZ, 00351 handshake_hash, FINISHED_SZ); 00352 00353 fin.set_length(TLS_FINISHED_SZ); // shorter length for TLS 00354 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::@17::p_hash | ( | output_buffer & | result, | |
| const output_buffer & | secret, | |||
| const output_buffer & | seed, | |||
| MACAlgorithm | hash | |||
| ) | [static] |
Definition at line 358 of file handshake.cpp.
References yaSSL::output_buffer::get_buffer(), yaSSL::output_buffer::get_capacity(), yaSSL::output_buffer::get_size(), hmac(), md5, MD5_LEN, NEW_YS, seed, SHA_LEN, yaSSL::output_buffer::write(), and ysDelete().
Referenced by PRF().
00360 { 00361 uint len = hash == md5 ? MD5_LEN : SHA_LEN; 00362 uint times = result.get_capacity() / len; 00363 uint lastLen = result.get_capacity() % len; 00364 opaque previous[SHA_LEN]; // max size 00365 opaque current[SHA_LEN]; // max size 00366 mySTL::auto_ptr<Digest> hmac(ysDelete); 00367 00368 if (lastLen) times += 1; 00369 00370 if (hash == md5) 00371 hmac.reset(NEW_YS HMAC_MD5(secret.get_buffer(), secret.get_size())); 00372 else 00373 hmac.reset(NEW_YS HMAC_SHA(secret.get_buffer(), secret.get_size())); 00374 // A0 = seed 00375 hmac->get_digest(previous, seed.get_buffer(), seed.get_size());// A1 00376 uint lastTime = times - 1; 00377 00378 for (uint i = 0; i < times; i++) { 00379 hmac->update(previous, len); 00380 hmac->get_digest(current, seed.get_buffer(), seed.get_size()); 00381 00382 if (lastLen && (i == lastTime)) 00383 result.write(current, lastLen); 00384 else { 00385 result.write(current, len); 00386 //memcpy(previous, current, len); 00387 hmac->get_digest(previous, previous, len); 00388 } 00389 } 00390 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 403 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::MD5::get_digest(), yaSSL::SSL::getSecurity(), yaSSL::Connection::master_secret_, MD5_LEN, memcpy, PAD1, PAD2, PAD_MD5, SECRET_LEN, yaSSL::sslHashes::use_MD5(), and yaSSL::SSL::useHashes().
Referenced by build_certHashes().
00404 { 00405 opaque md5_result[MD5_LEN]; 00406 opaque md5_inner[SECRET_LEN + PAD_MD5]; 00407 opaque md5_outer[SECRET_LEN + PAD_MD5 + MD5_LEN]; 00408 00409 const opaque* master_secret = 00410 ssl.getSecurity().get_connection().master_secret_; 00411 00412 // make md5 inner 00413 memcpy(md5_inner, master_secret, SECRET_LEN); 00414 memcpy(&md5_inner[SECRET_LEN], PAD1, PAD_MD5); 00415 00416 ssl.useHashes().use_MD5().get_digest(md5_result, md5_inner, 00417 sizeof(md5_inner)); 00418 00419 // make md5 outer 00420 memcpy(md5_outer, master_secret, SECRET_LEN); 00421 memcpy(&md5_outer[SECRET_LEN], PAD2, PAD_MD5); 00422 memcpy(&md5_outer[SECRET_LEN + PAD_MD5], md5_result, MD5_LEN); 00423 00424 ssl.useHashes().use_MD5().get_digest(digest, md5_outer, sizeof(md5_outer)); 00425 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 429 of file handshake.cpp.
References yaSSL::Security::get_connection(), yaSSL::SHA::get_digest(), yaSSL::SSL::getSecurity(), yaSSL::Connection::master_secret_, memcpy, PAD1, PAD2, PAD_SHA, SECRET_LEN, SHA_LEN, yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by build_certHashes().
00430 { 00431 opaque sha_result[SHA_LEN]; 00432 opaque sha_inner[SECRET_LEN + PAD_SHA]; 00433 opaque sha_outer[SECRET_LEN + PAD_SHA + SHA_LEN]; 00434 00435 const opaque* master_secret = 00436 ssl.getSecurity().get_connection().master_secret_; 00437 00438 // make sha inner 00439 memcpy(sha_inner, master_secret, SECRET_LEN); 00440 memcpy(&sha_inner[SECRET_LEN], PAD1, PAD_SHA); 00441 00442 ssl.useHashes().use_SHA().get_digest(sha_result, sha_inner, 00443 sizeof(sha_inner)); 00444 00445 // make sha outer 00446 memcpy(sha_outer, master_secret, SECRET_LEN); 00447 memcpy(&sha_outer[SECRET_LEN], PAD2, PAD_SHA); 00448 memcpy(&sha_outer[SECRET_LEN + PAD_SHA], sha_result, SHA_LEN); 00449 00450 ssl.useHashes().use_SHA().get_digest(digest, sha_outer, sizeof(sha_outer)); 00451 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::ProcessOldClientHello | ( | input_buffer & | input, | |
| SSL & | ssl | |||
| ) |
Definition at line 458 of file handshake.cpp.
References ato16(), AUTO, bad_input, buffer, yaSSL::ClientHello::cipher_suites_, yaSSL::ClientHello::client_version_, yaSSL::input_buffer::get_buffer(), yaSSL::input_buffer::get_current(), yaSSL::input_buffer::get_remaining(), yaSSL::ClientHello::id_len_, yaSSL::ProtocolVersion::major_, memset, yaSSL::ProtocolVersion::minor_, yaSSL::ClientHello::Process(), RAN_LEN, yaSSL::ClientHello::random_, yaSSL::input_buffer::read(), yaSSL::ClientHello::session_id_, yaSSL::SSL::SetError(), SUITE_LEN, yaSSL::ClientHello::suite_len_, yaSSL::SHA::update(), yaSSL::MD5::update(), yaSSL::sslHashes::use_MD5(), yaSSL::sslHashes::use_SHA(), and yaSSL::SSL::useHashes().
Referenced by DoProcessReply().
00459 { 00460 byte b0 = input[AUTO]; 00461 byte b1 = input[AUTO]; 00462 00463 uint16 sz = ((b0 & 0x7f) << 8) | b1; 00464 00465 if (sz > input.get_remaining()) { 00466 ssl.SetError(bad_input); 00467 return; 00468 } 00469 00470 // hashHandShake manually 00471 const opaque* buffer = input.get_buffer() + input.get_current(); 00472 ssl.useHashes().use_MD5().update(buffer, sz); 00473 ssl.useHashes().use_SHA().update(buffer, sz); 00474 00475 b1 = input[AUTO]; // does this value mean client_hello? 00476 00477 ClientHello ch; 00478 ch.client_version_.major_ = input[AUTO]; 00479 ch.client_version_.minor_ = input[AUTO]; 00480 00481 byte len[2]; 00482 00483 input.read(len, sizeof(len)); 00484 ato16(len, ch.suite_len_); 00485 00486 input.read(len, sizeof(len)); 00487 uint16 sessionLen; 00488 ato16(len, sessionLen); 00489 ch.id_len_ = sessionLen; 00490 00491 input.read(len, sizeof(len)); 00492 uint16 randomLen; 00493 ato16(len, randomLen); 00494 00495 int j = 0; 00496 for (uint16 i = 0; i < ch.suite_len_; i += 3) { 00497 byte first = input[AUTO]; 00498 if (first) // sslv2 type 00499 input.read(len, SUITE_LEN); // skip 00500 else { 00501 input.read(&ch.cipher_suites_[j], SUITE_LEN); 00502 j += SUITE_LEN; 00503 } 00504 } 00505 ch.suite_len_ = j; 00506 00507 if (ch.id_len_) 00508 input.read(ch.session_id_, ch.id_len_); 00509 00510 if (randomLen < RAN_LEN) 00511 memset(ch.random_, 0, RAN_LEN - randomLen); 00512 input.read(&ch.random_[RAN_LEN - randomLen], randomLen); 00513 00514 00515 ch.Process(input, ssl); 00516 }
Here is the call graph for this function:

Here is the caller graph for this function:

| mySTL::auto_ptr<input_buffer> yaSSL::DoProcessReply | ( | SSL & | ssl, | |
| mySTL::auto_ptr< input_buffer > | buffered | |||
| ) |
Definition at line 665 of file handshake.cpp.
References buffer, buffered, clientNull, yaSSL::Factory< AbstractProduct, IdentifierType, ProductCreator >::CreateObject(), decrypt_message(), yaSSL::Parameters::entity_, factory_error, yaSSL::Security::get_parms(), yaSSL::Socket::get_ready(), yaSSL::SSL::GetError(), yaSSL::SSL::getFactory(), yaSSL::sslFactory::getMessage(), yaSSL::SSL::getSecurity(), yaSSL::States::getServer(), yaSSL::SSL::getSocket(), yaSSL::SSL::getStates(), handshake, NEW_YS, offset, yaSSL::Parameters::pending_, ProcessOldClientHello(), yaSSL::Socket::receive(), receive_error, RECORD_HEADER, server_end, yaSSL::SSL::SetError(), yaSSL::SSL::useSocket(), yaSSL::SSL::verifyState(), yaSSL::Socket::wait(), and ysDelete().
Referenced by processReply().
00666 { 00667 // wait for input if blocking 00668 if (!ssl.useSocket().wait()) { 00669 ssl.SetError(receive_error); 00670 buffered.reset(0); 00671 return buffered; 00672 } 00673 uint ready = ssl.getSocket().get_ready(); 00674 if (!ready) return buffered; 00675 00676 // add buffered data if its there 00677 uint buffSz = buffered.get() ? buffered.get()->get_size() : 0; 00678 input_buffer buffer(buffSz + ready); 00679 if (buffSz) { 00680 buffer.assign(buffered.get()->get_buffer(), buffSz); 00681 buffered.reset(0); 00682 } 00683 00684 // add new data 00685 uint read = ssl.useSocket().receive(buffer.get_buffer() + buffSz, ready); 00686 buffer.add_size(read); 00687 uint offset = 0; 00688 const MessageFactory& mf = ssl.getFactory().getMessage(); 00689 00690 // old style sslv2 client hello? 00691 if (ssl.getSecurity().get_parms().entity_ == server_end && 00692 ssl.getStates().getServer() == clientNull) 00693 if (buffer.peek() != handshake) { 00694 ProcessOldClientHello(buffer, ssl); 00695 if (ssl.GetError()) { 00696 buffered.reset(0); 00697 return buffered; 00698 } 00699 } 00700 00701 while(!buffer.eof()) { 00702 // each record 00703 RecordLayerHeader hdr; 00704 bool needHdr = false; 00705 00706 if (static_cast<uint>(RECORD_HEADER) > buffer.get_remaining()) 00707 needHdr = true; 00708 else { 00709 buffer >> hdr; 00710 ssl.verifyState(hdr); 00711 } 00712 00713 // make sure we have enough input in buffer to process this record 00714 if (needHdr || hdr.length_ > buffer.get_remaining()) { 00715 // put header in front for next time processing 00716 uint extra = needHdr ? 0 : RECORD_HEADER; 00717 uint sz = buffer.get_remaining() + extra; 00718 buffered.reset(NEW_YS input_buffer(sz, buffer.get_buffer() + 00719 buffer.get_current() - extra, sz)); 00720 break; 00721 } 00722 00723 while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) { 00724 // each message in record, can be more than 1 if not encrypted 00725 if (ssl.getSecurity().get_parms().pending_ == false) // cipher on 00726 decrypt_message(ssl, buffer, hdr.length_); 00727 mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_), ysDelete); 00728 if (!msg.get()) { 00729 ssl.SetError(factory_error); 00730 buffered.reset(0); 00731 return buffered; 00732 } 00733 buffer >> *msg; 00734 msg->Process(buffer, ssl); 00735 if (ssl.GetError()) { 00736 buffered.reset(0); 00737 return buffered; 00738 } 00739 } 00740 offset += hdr.length_ + RECORD_HEADER; 00741 } 00742 return buffered; 00743 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 61 of file ssl.cpp.
References CA, Cert, ctx, NEW_YS, PemToDer(), SEEK_END, SSL_BAD_FILE, SSL_BAD_FILETYPE, SSL_FILETYPE_ASN1, SSL_FILETYPE_PEM, SSL_SUCCESS, and x.
Referenced by SSL_CTX_load_verify_locations(), SSL_CTX_use_certificate_file(), and SSL_CTX_use_PrivateKey_file().
00062 { 00063 if (format != SSL_FILETYPE_ASN1 && format != SSL_FILETYPE_PEM) 00064 return SSL_BAD_FILETYPE; 00065 00066 FILE* input = fopen(file, "rb"); 00067 if (!input) 00068 return SSL_BAD_FILE; 00069 00070 if (type == CA) { 00071 // may have a bunch of CAs 00072 x509* ptr; 00073 while ( (ptr = PemToDer(input, Cert)) ) 00074 ctx->AddCA(ptr); 00075 00076 if (!feof(input)) { 00077 fclose(input); 00078 return SSL_BAD_FILE; 00079 } 00080 } 00081 else { 00082 x509*& x = (type == Cert) ? ctx->certificate_ : ctx->privateKey_; 00083 00084 if (format == SSL_FILETYPE_ASN1) { 00085 fseek(input, 0, SEEK_END); 00086 long sz = ftell(input); 00087 rewind(input); 00088 x = NEW_YS x509(sz); // takes ownership 00089 size_t bytes = fread(x->use_buffer(), sz, 1, input); 00090 if (bytes != 1) { 00091 fclose(input); 00092 return SSL_BAD_FILE; 00093 } 00094 } 00095 else { 00096 x = PemToDer(input, type); 00097 if (!x) { 00098 fclose(input); 00099 return SSL_BAD_FILE; 00100 } 00101 } 00102 } 00103 fclose(input); 00104 return SSL_SUCCESS; 00105 }
Here is the call graph for this function:

Here is the caller graph for this function:

| SSL_METHOD* yaSSL::SSLv3_method | ( | void | ) |
Definition at line 111 of file ssl.cpp.
References SSLv3_client_method().
00112 { 00113 return SSLv3_client_method(); 00114 }
Here is the call graph for this function:

| SSL_METHOD* yaSSL::SSLv3_server_method | ( | void | ) |
Definition at line 117 of file ssl.cpp.
References NEW_YS, and server_end.
Referenced by SSLv23_server_method().
00118 { 00119 return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,0)); 00120 }
Here is the caller graph for this function:

| SSL_METHOD* yaSSL::SSLv3_client_method | ( | void | ) |
Definition at line 123 of file ssl.cpp.
References client_end, and NEW_YS.
Referenced by SSLv23_client_method(), and SSLv3_method().
00124 { 00125 return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,0)); 00126 }
Here is the caller graph for this function:

| SSL_METHOD* yaSSL::TLSv1_server_method | ( | void | ) |
Definition at line 129 of file ssl.cpp.
References NEW_YS, and server_end.
00130 { 00131 return NEW_YS SSL_METHOD(server_end, ProtocolVersion(3,1)); 00132 }
| SSL_METHOD* yaSSL::TLSv1_client_method | ( | void | ) |
Definition at line 135 of file ssl.cpp.
References client_end, and NEW_YS.
00136 { 00137 return NEW_YS SSL_METHOD(client_end, ProtocolVersion(3,1)); 00138 }
| SSL_METHOD* yaSSL::SSLv23_server_method | ( | void | ) |
Definition at line 141 of file ssl.cpp.
References SSLv3_server_method().
00142 { 00143 // compatibility only, no version 2 support 00144 return SSLv3_server_method(); 00145 }
Here is the call graph for this function:

| SSL_CTX* yaSSL::SSL_CTX_new | ( | SSL_METHOD * | method | ) |
| void yaSSL::SSL_CTX_free | ( | SSL_CTX * | ctx | ) |
Definition at line 154 of file ssl.cpp.
References ctx, and ysDelete().
Referenced by yaSSL::Base::~Base().
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::SSL_free | ( | SSL * | ssl | ) |
Definition at line 166 of file ssl.cpp.
References ysDelete().
Referenced by yaSSL::Base::~Base().
00167 { 00168 ysDelete(ssl); 00169 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_set_fd | ( | SSL * | ssl, | |
| int | fd | |||
| ) |
Definition at line 172 of file ssl.cpp.
References yaSSL::Socket::set_fd(), SSL_SUCCESS, and yaSSL::SSL::useSocket().
00173 { 00174 ssl->useSocket().set_fd(fd); 00175 return SSL_SUCCESS; 00176 }
Here is the call graph for this function:

| int yaSSL::SSL_connect | ( | SSL * | ssl | ) |
Definition at line 179 of file ssl.cpp.
References client_end, yaSSL::SSL::flushBuffer(), yaSSL::Crypto::get_certManager(), yaSSL::Socket::get_fd(), yaSSL::Security::get_resuming(), yaSSL::States::getClient(), yaSSL::SSL::getCrypto(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), yaSSL::SSL::getSocket(), yaSSL::SSL::getStates(), processReply(), sendCertificate(), sendCertificateVerify(), sendChangeCipher(), sendClientHello(), sendClientKeyExchange(), sendFinished(), yaSSL::CertManager::sendVerify(), serverFinishedComplete, serverHelloDoneComplete, yaSSL::Log::ShowTCP(), SSL_FATAL_ERROR, SSL_SUCCESS, yaSSL::SSL::useLog(), and yaSSL::SSL::verifyState().
Referenced by yaSSL::Client::Connect(), and SSL_do_handshake().
00180 { 00181 sendClientHello(*ssl); 00182 ClientState neededState = ssl->getSecurity().get_resuming() ? 00183 serverFinishedComplete : serverHelloDoneComplete; 00184 while (ssl->getStates().getClient() < neededState) { 00185 if (ssl->GetError()) break; 00186 processReply(*ssl); 00187 } 00188 00189 if(ssl->getCrypto().get_certManager().sendVerify()) 00190 sendCertificate(*ssl); 00191 00192 if (!ssl->getSecurity().get_resuming()) 00193 sendClientKeyExchange(*ssl); 00194 00195 if(ssl->getCrypto().get_certManager().sendVerify()) 00196 sendCertificateVerify(*ssl); 00197 00198 sendChangeCipher(*ssl); 00199 sendFinished(*ssl, client_end); 00200 ssl->flushBuffer(); 00201 if (!ssl->getSecurity().get_resuming()) 00202 while (ssl->getStates().getClient() < serverFinishedComplete) { 00203 if (ssl->GetError()) break; 00204 processReply(*ssl); 00205 } 00206 00207 ssl->verifyState(serverFinishedComplete); 00208 ssl->useLog().ShowTCP(ssl->getSocket().get_fd()); 00209 00210 if (ssl->GetError()) 00211 return SSL_FATAL_ERROR; 00212 return SSL_SUCCESS; 00213 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_write | ( | SSL * | ssl, | |
| const void * | buffer, | |||
| int | sz | |||
| ) |
Definition at line 216 of file ssl.cpp.
References sendData().
Here is the call graph for this function:

| int yaSSL::SSL_read | ( | SSL * | ssl, | |
| void * | buffer, | |||
| int | sz | |||
| ) |
Definition at line 222 of file ssl.cpp.
References data, MAX_RECORD_SIZE, min, and receiveData().
00223 { 00224 Data data(min(sz, MAX_RECORD_SIZE), static_cast<opaque*>(buffer)); 00225 return receiveData(*ssl, data); 00226 }
Here is the call graph for this function:

| int yaSSL::SSL_accept | ( | SSL * | ssl | ) |
Definition at line 229 of file ssl.cpp.
References clientFinishedComplete, yaSSL::SSL::flushBuffer(), yaSSL::Crypto::get_certManager(), yaSSL::Security::get_connection(), yaSSL::Socket::get_fd(), yaSSL::Security::get_resuming(), yaSSL::SSL::getCrypto(), yaSSL::SSL::GetError(), yaSSL::SSL::getSecurity(), yaSSL::States::getServer(), yaSSL::SSL::getSocket(), yaSSL::SSL::getStates(), processReply(), yaSSL::Connection::send_server_key_, sendCertificate(), sendCertificateRequest(), sendChangeCipher(), sendFinished(), sendServerHello(), sendServerHelloDone(), sendServerKeyExchange(), server_end, yaSSL::Log::ShowTCP(), SSL_FATAL_ERROR, SSL_SUCCESS, yaSSL::SSL::useLog(), and yaSSL::CertManager::verifyPeer().
Referenced by yaSSL::Server::Accept(), and SSL_do_handshake().
00230 { 00231 processReply(*ssl); 00232 sendServerHello(*ssl); 00233 00234 if (!ssl->getSecurity().get_resuming()) { 00235 sendCertificate(*ssl); 00236 00237 if (ssl->getSecurity().get_connection().send_server_key_) 00238 sendServerKeyExchange(*ssl); 00239 00240 if(ssl->getCrypto().get_certManager().verifyPeer()) 00241 sendCertificateRequest(*ssl); 00242 00243 sendServerHelloDone(*ssl); 00244 ssl->flushBuffer(); 00245 00246 while (ssl->getStates().getServer() < clientFinishedComplete) { 00247 if (ssl->GetError()) break; 00248 processReply(*ssl); 00249 } 00250 } 00251 sendChangeCipher(*ssl); 00252 sendFinished(*ssl, server_end); 00253 ssl->flushBuffer(); 00254 if (ssl->getSecurity().get_resuming()) { 00255 while (ssl->getStates().getServer() < clientFinishedComplete) { 00256 if (ssl->GetError()) break; 00257 processReply(*ssl); 00258 } 00259 } 00260 00261 ssl->useLog().ShowTCP(ssl->getSocket().get_fd()); 00262 00263 if (ssl->GetError()) 00264 return SSL_FATAL_ERROR; 00265 return SSL_SUCCESS; 00266 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_do_handshake | ( | SSL * | ssl | ) |
Definition at line 269 of file ssl.cpp.
References client_end, yaSSL::Parameters::entity_, yaSSL::Security::get_parms(), yaSSL::SSL::getSecurity(), SSL_accept(), and SSL_connect().
00270 { 00271 if (ssl->getSecurity().get_parms().entity_ == client_end) 00272 return SSL_connect(ssl); 00273 else 00274 return SSL_accept(ssl); 00275 }
Here is the call graph for this function:

| int yaSSL::SSL_clear | ( | SSL * | ssl | ) |
Definition at line 278 of file ssl.cpp.
References yaSSL::Socket::closeSocket(), SSL_SUCCESS, and yaSSL::SSL::useSocket().
00279 { 00280 ssl->useSocket().closeSocket(); 00281 return SSL_SUCCESS; 00282 }
Here is the call graph for this function:

| int yaSSL::SSL_shutdown | ( | SSL * | ssl | ) |
Definition at line 285 of file ssl.cpp.
References alert, close_notify, yaSSL::Socket::closeSocket(), yaSSL::Socket::get_fd(), yaSSL::SSL::getSocket(), sendAlert(), yaSSL::Log::ShowTCP(), SSL_SUCCESS, yaSSL::SSL::useLog(), yaSSL::SSL::useSocket(), and warning.
00286 { 00287 Alert alert(warning, close_notify); 00288 sendAlert(*ssl, alert); 00289 ssl->useLog().ShowTCP(ssl->getSocket().get_fd(), true); 00290 ssl->useSocket().closeSocket(); 00291 00292 return SSL_SUCCESS; 00293 }
Here is the call graph for this function:

| SSL_SESSION* yaSSL::SSL_get_session | ( | SSL * | ssl | ) |
Definition at line 296 of file ssl.cpp.
References yaSSL::Security::get_connection(), yaSSL::SSL::getSecurity(), GetSessions(), yaSSL::Sessions::lookup(), and yaSSL::Connection::sessionID_.
Referenced by SSL_get1_session().
00297 { 00298 return GetSessions().lookup( 00299 ssl->getSecurity().get_connection().sessionID_); 00300 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_set_session | ( | SSL * | ssl, | |
| SSL_SESSION * | session | |||
| ) |
Definition at line 303 of file ssl.cpp.
References yaSSL::SSL::set_session(), and SSL_SUCCESS.
00304 { 00305 ssl->set_session(session); 00306 return SSL_SUCCESS; 00307 }
Here is the call graph for this function:

| int yaSSL::SSL_session_reused | ( | SSL * | ssl | ) |
Definition at line 310 of file ssl.cpp.
References yaSSL::Security::get_resuming(), and yaSSL::SSL::getSecurity().
Here is the call graph for this function:

| long yaSSL::SSL_SESSION_set_timeout | ( | SSL_SESSION * | sess, | |
| long | t | |||
| ) |
Definition at line 316 of file ssl.cpp.
References yaSSL::SSL_SESSION::SetTimeOut(), SSL_ERROR_NONE, and SSL_SUCCESS.
00317 { 00318 if (!sess) 00319 return SSL_ERROR_NONE; 00320 00321 sess->SetTimeOut(t); 00322 return SSL_SUCCESS; 00323 }
Here is the call graph for this function:

| long yaSSL::SSL_get_default_timeout | ( | SSL * | ) |
Definition at line 326 of file ssl.cpp.
References DEFAULT_TIMEOUT.
00327 { 00328 return DEFAULT_TIMEOUT; 00329 }
| const char* yaSSL::SSL_get_cipher_name | ( | SSL * | ssl | ) |
Definition at line 332 of file ssl.cpp.
References SSL_get_cipher().
00333 { 00334 return SSL_get_cipher(ssl); 00335 }
Here is the call graph for this function:

| const char* yaSSL::SSL_get_cipher | ( | SSL * | ssl | ) |
Definition at line 338 of file ssl.cpp.
References yaSSL::Parameters::cipher_name_, yaSSL::Security::get_parms(), and yaSSL::SSL::getSecurity().
Referenced by SSL_get_cipher_name().
Here is the call graph for this function:

Here is the caller graph for this function:

| char* yaSSL::SSL_get_shared_ciphers | ( | SSL * | , | |
| char * | buf, | |||
| int | len | |||
| ) |
| const char* yaSSL::SSL_get_cipher_list | ( | SSL * | ssl, | |
| int | priority | |||
| ) |
Definition at line 351 of file ssl.cpp.
References yaSSL::Parameters::cipher_list_, yaSSL::Security::get_parms(), yaSSL::SSL::getSecurity(), and MAX_CIPHERS.
00352 { 00353 if (priority < 0 || priority >= MAX_CIPHERS) 00354 return 0; 00355 00356 if (ssl->getSecurity().get_parms().cipher_list_[priority][0]) 00357 return ssl->getSecurity().get_parms().cipher_list_[priority]; 00358 00359 return 0; 00360 }
Here is the call graph for this function:

| int yaSSL::SSL_CTX_set_cipher_list | ( | SSL_CTX * | ctx, | |
| const char * | list | |||
| ) |
Definition at line 363 of file ssl.cpp.
References ctx, SSL_FAILURE, and SSL_SUCCESS.
00364 { 00365 if (ctx->SetCipherList(list)) 00366 return SSL_SUCCESS; 00367 else 00368 return SSL_FAILURE; 00369 }
| const char* yaSSL::SSL_get_version | ( | SSL * | ssl | ) |
Definition at line 372 of file ssl.cpp.
References yaSSL::SSL::isTLS().
00373 { 00374 static const char* version3 = "SSLv3"; 00375 static const char* version31 = "TLSv1"; 00376 00377 return ssl->isTLS() ? version31 : version3; 00378 }
Here is the call graph for this function:

| const char* yaSSL::SSLeay_version | ( | int | ) |
| int yaSSL::SSL_get_error | ( | SSL * | ssl, | |
| int | ||||
| ) |
Definition at line 387 of file ssl.cpp.
References yaSSL::SSL::getStates(), and yaSSL::States::What().
Here is the call graph for this function:

Definition at line 393 of file ssl.cpp.
References yaSSL::Crypto::get_certManager(), yaSSL::CertManager::get_peerX509(), and yaSSL::SSL::getCrypto().
Here is the call graph for this function:

| void yaSSL::X509_free | ( | X509 * | ) |
| X509* yaSSL::X509_STORE_CTX_get_current_cert | ( | X509_STORE_CTX * | ctx | ) |
| int yaSSL::X509_STORE_CTX_get_error | ( | X509_STORE_CTX * | ctx | ) |
| int yaSSL::X509_STORE_CTX_get_error_depth | ( | X509_STORE_CTX * | ctx | ) |
| char* yaSSL::X509_NAME_oneline | ( | X509_NAME * | name, | |
| char * | buffer, | |||
| int | sz | |||
| ) |
Definition at line 426 of file ssl.cpp.
References malloc, memcpy, min, name, and strlen().
00427 { 00428 if (!name->GetName()) return buffer; 00429 00430 int len = strlen(name->GetName()) + 1; 00431 int copySz = min(len, sz); 00432 00433 if (!buffer) { 00434 buffer = (char*)malloc(len); 00435 if (!buffer) return buffer; 00436 copySz = len; 00437 } 00438 00439 if (copySz == 0) 00440 return buffer; 00441 00442 memcpy(buffer, name->GetName(), copySz - 1); 00443 buffer[copySz - 1] = 0; 00444 00445 return buffer; 00446 }
Here is the call graph for this function:

| void yaSSL::SSL_set_connect_state | ( | SSL * | ) |
| void yaSSL::SSL_set_accept_state | ( | SSL * | ssl | ) |
Definition at line 471 of file ssl.cpp.
References yaSSL::Parameters::entity_, server_end, yaSSL::Security::use_parms(), and yaSSL::SSL::useSecurity().
00472 { 00473 ssl->useSecurity().use_parms().entity_ = server_end; 00474 }
Here is the call graph for this function:

| long yaSSL::SSL_get_verify_result | ( | SSL * | ) |
| long yaSSL::SSL_CTX_sess_set_cache_size | ( | SSL_CTX * | , | |
| long | ||||
| ) |
| long yaSSL::SSL_CTX_get_session_cache_mode | ( | SSL_CTX * | ) |
Definition at line 498 of file ssl.cpp.
References ctx, SSL_FAILURE, and SSL_SUCCESS.
Referenced by SetDH().
00499 { 00500 if (ctx->SetDH(*dh)) 00501 return SSL_SUCCESS; 00502 else 00503 return SSL_FAILURE; 00504 }
Here is the caller graph for this function:

| int yaSSL::SSL_CTX_use_certificate_file | ( | SSL_CTX * | ctx, | |
| const char * | file, | |||
| int | format | |||
| ) |
Definition at line 507 of file ssl.cpp.
References Cert, ctx, and read_file().
Referenced by SetUpBase().
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_CTX_use_PrivateKey_file | ( | SSL_CTX * | ctx, | |
| const char * | file, | |||
| int | format | |||
| ) |
Definition at line 513 of file ssl.cpp.
References ctx, PrivateKey, and read_file().
Referenced by SetUpBase().
00514 { 00515 return read_file(ctx, file, format, PrivateKey); 00516 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void yaSSL::SSL_CTX_set_verify | ( | SSL_CTX * | ctx, | |
| int | mode, | |||
| VerifyCallback | ||||
| ) |
Definition at line 519 of file ssl.cpp.
References ctx, SSL_VERIFY_FAIL_IF_NO_PEER_CERT, SSL_VERIFY_NONE, and SSL_VERIFY_PEER.
00520 { 00521 if (mode & SSL_VERIFY_PEER) 00522 ctx->setVerifyPeer(); 00523 00524 if (mode == SSL_VERIFY_NONE) 00525 ctx->setVerifyNone(); 00526 00527 if (mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) 00528 ctx->setFailNoCert(); 00529 }
| int yaSSL::SSL_CTX_load_verify_locations | ( | SSL_CTX * | ctx, | |
| const char * | file, | |||
| const char * | path | |||
| ) |
Definition at line 532 of file ssl.cpp.
References CA, ctx, dirent, HANDLE, name, read_file(), SSL_BAD_PATH, SSL_BAD_STAT, SSL_FILETYPE_PEM, and SSL_SUCCESS.
Referenced by SetUpBase().
00534 { 00535 int ret = SSL_SUCCESS; 00536 const int HALF_PATH = 128; 00537 00538 if (file) ret = read_file(ctx, file, SSL_FILETYPE_PEM, CA); 00539 00540 if (ret == SSL_SUCCESS && path) { 00541 // call read_file for each reqular file in path 00542 #ifdef _WIN32 00543 00544 WIN32_FIND_DATA FindFileData; 00545 HANDLE hFind; 00546 00547 char name[MAX_PATH + 1]; // directory specification 00548 strncpy(name, path, MAX_PATH - 3); 00549 strncat(name, "\\*", 3); 00550 00551 hFind = FindFirstFile(name, &FindFileData); 00552 if (hFind == INVALID_HANDLE_VALUE) return SSL_BAD_PATH; 00553 00554 do { 00555 if (FindFileData.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY) { 00556 strncpy(name, path, MAX_PATH - 2 - HALF_PATH); 00557 strncat(name, "\\", 2); 00558 strncat(name, FindFileData.cFileName, HALF_PATH); 00559 ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA); 00560 } 00561 } while (ret == SSL_SUCCESS && FindNextFile(hFind, &FindFileData)); 00562 00563 FindClose(hFind); 00564 00565 #else // _WIN32 00566 00567 const int MAX_PATH = 260; 00568 00569 DIR* dir = opendir(path); 00570 if (!dir) return SSL_BAD_PATH; 00571 00572 struct dirent* entry; 00573 struct stat buf; 00574 char name[MAX_PATH + 1]; 00575 00576 while (ret == SSL_SUCCESS && (entry = readdir(dir))) { 00577 strncpy(name, path, MAX_PATH - 1 - HALF_PATH); 00578 strncat(name, "/", 1); 00579 strncat(name, entry->d_name, HALF_PATH); 00580 if (stat(name, &buf) < 0) return SSL_BAD_STAT; 00581 00582 if (S_ISREG(buf.st_mode)) 00583 ret = read_file(ctx, name, SSL_FILETYPE_PEM, CA); 00584 } 00585 00586 closedir(dir); 00587 00588 #endif 00589 } 00590 00591 return ret; 00592 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int yaSSL::SSL_CTX_set_default_verify_paths | ( | SSL_CTX * | ) |
Definition at line 595 of file ssl.cpp.
References SSL_NOT_IMPLEMENTED.
00596 { 00597 // TODO: figure out way to set/store default path, then call load_verify 00598 return SSL_NOT_IMPLEMENTED; 00599 }
| int yaSSL::SSL_CTX_set_session_id_context | ( | SSL_CTX * | , | |
| const unsigned char * | , | |||
| unsigned | int | |||
| ) |
Definition at line 602 of file ssl.cpp.
References SSL_SUCCESS.
00604 { 00605 // No application specific context needed for yaSSL 00606 return SSL_SUCCESS; 00607 }
| int yaSSL::SSL_CTX_check_private_key | ( | SSL_CTX * | ) |
Definition at line 610 of file ssl.cpp.
References SSL_NOT_IMPLEMENTED.
00611 { 00612 // TODO: check private against public for RSA match 00613 return SSL_NOT_IMPLEMENTED; 00614 }
| long yaSSL::SSL_CTX_sess_accept | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_connect | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_accept_good | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_connect_good | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_accept_renegotiate | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_connect_renegotiate | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_hits | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_cb_hits | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_cache_full | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_misses | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_timeouts | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_number | ( | SSL_CTX * | ctx | ) |
| long yaSSL::SSL_CTX_sess_get_cache_size | ( | SSL_CTX * | ctx | ) |
| int yaSSL::SSL_CTX_get_verify_mode | ( | SSL_CTX * | ctx | ) |
| int yaSSL::SSL_get_verify_mode | ( | SSL * | ssl | ) |
Definition at line 703 of file ssl.cpp.
References yaSSL::Security::GetContext(), yaSSL::SSL::getSecurity(), yaSSL::SSL_CTX::GetStats(), and yaSSL::Stats::verifyMode_.
Here is the call graph for this function:

| int yaSSL::SSL_CTX_get_verify_depth | ( | SSL_CTX * | ctx | ) |
| int yaSSL::SSL_get_verify_depth | ( | SSL * | ssl | ) |
Definition at line 715 of file ssl.cpp.
References yaSSL::Security::GetContext(), yaSSL::SSL::getSecurity(), yaSSL::SSL_CTX::GetStats(), and yaSSL::Stats::verifyDepth_.
Here is the call graph for this function:

| long yaSSL::SSL_CTX_set_options | ( | SSL_CTX * | , | |
| long | ||||
| ) |
Definition at line 721 of file ssl.cpp.
References SSL_SUCCESS.
00722 { 00723 // TDOD: 00724 return SSL_SUCCESS; 00725 }
| void yaSSL::SSL_CTX_set_info_callback | ( | SSL_CTX * | , | |
| void(*)() | ||||
| ) |
| int yaSSL::SSL_library_init | ( | ) |
| DH* yaSSL::DH_new | ( | void | ) |
| void yaSSL::DH_free | ( | DH * | dh | ) |
Definition at line 763 of file ssl.cpp.
References yaSSL::BIGNUM::assign(), NEW_YS, and ysDelete().
Referenced by SetDH().
00764 { 00765 using mySTL::auto_ptr; 00766 bool created = false; 00767 auto_ptr<BIGNUM> bn(ysDelete); 00768 00769 if (!retVal) { 00770 created = true; 00771 bn.reset(NEW_YS BIGNUM); 00772 retVal = bn.get(); 00773 } 00774 00775 retVal->assign(num, sz); 00776 00777 if (created) 00778 return bn.release(); 00779 else 00780 return retVal; 00781 }
Here is the call graph for this function:

Here is the caller graph for this function:

| unsigned long yaSSL::ERR_get_error_line_data | ( | const char ** | , | |
| int * | , | |||
| const char ** | , | |||
| int * | ||||
| ) |
| void yaSSL::ERR_print_errors_fp | ( | FILE * | ) |
| char* yaSSL::ERR_error_string | ( | unsigned long | errNumber, | |
| char * | buffer | |||
| ) |
Definition at line 798 of file ssl.cpp.
References SetErrorString().
Referenced by ERR_error_string_n().
00799 { 00800 static char* msg = "Please supply a buffer for error string"; 00801 00802 if (buffer) { 00803 SetErrorString(YasslError(errNumber), buffer); 00804 return buffer; 00805 } 00806 00807 return msg; 00808 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* yaSSL::X509_verify_cert_error_string | ( | long | ) |
| const EVP_MD* yaSSL::EVP_md5 | ( | void | ) |
| const EVP_CIPHER* yaSSL::EVP_des_ede3_cbc | ( | void | ) |
| int yaSSL::EVP_BytesToKey | ( | const EVP_CIPHER * | type, | |
| const EVP_MD * | md, | |||
| const byte * | salt, | |||
| const byte * | data, | |||
| int | sz, | |||
| int | count, | |||
| byte * | key, | |||
| byte * | iv | |||
| ) |
Definition at line 833 of file ssl.cpp.
References assert, cipher, EVP_SALT_SZ, yaSSL::MD5::get_digest(), yaSSL::MD5::get_digestSize(), memcpy, min, SHA_LEN, and yaSSL::MD5::update().
00835 { 00836 // only support MD5 for now 00837 if (strncmp(md, "MD5", 3)) return 0; 00838 00839 // only support DES_EDE3_CBC for now 00840 if (strncmp(type, "DES_EDE3_CBC", 12)) return 0; 00841 00842 yaSSL::MD5 myMD; 00843 uint digestSz = myMD.get_digestSize(); 00844 byte digest[SHA_LEN]; // max size 00845 00846 yaSSL::DES_EDE cipher; 00847 int keyLen = cipher.get_keySize(); 00848 int ivLen = cipher.get_ivSize(); 00849 int keyLeft = keyLen; 00850 int ivLeft = ivLen; 00851 int keyOutput = 0; 00852 00853 while (keyOutput < (keyLen + ivLen)) { 00854 int digestLeft = digestSz; 00855 // D_(i - 1) 00856 if (keyOutput) // first time D_0 is empty 00857 myMD.update(digest, digestSz); 00858 // data 00859 myMD.update(data, sz); 00860 // salt 00861 if (salt) 00862 myMD.update(salt, EVP_SALT_SZ); 00863 myMD.get_digest(digest); 00864 // count 00865 for (int j = 1; j < count; j++) { 00866 myMD.update(digest, digestSz); 00867 myMD.get_digest(digest); 00868 } 00869 00870 if (keyLeft) { 00871 int store = min(keyLeft, static_cast<int>(digestSz)); 00872 memcpy(&key[keyLen - keyLeft], digest, store); 00873 00874 keyOutput += store; 00875 keyLeft -= store; 00876 digestLeft -= store; 00877 } 00878 00879 if (ivLeft && digestLeft) { 00880 int store = min(ivLeft, digestLeft); 00881 memcpy(&iv[ivLen - ivLeft], digest, store); 00882 00883 keyOutput += store; 00884 ivLeft -= store; 00885 } 00886 } 00887 assert(keyOutput == (keyLen + ivLen)); 00888 return keyOutput; 00889 }
Here is the call graph for this function:

| void yaSSL::DES_set_key_unchecked | ( | const_DES_cblock * | key, | |
| DES_key_schedule * | schedule | |||
| ) |
| void yaSSL::DES_ede3_cbc_encrypt | ( | const byte * | input, | |
| byte * | output, | |||
| long | sz, | |||
| DES_key_schedule * | ks1, | |||
| DES_key_schedule * | ks2, | |||
| DES_key_schedule * | ks3, | |||
| DES_cblock * | ivec, | |||
| int | enc | |||
| ) |
Definition at line 899 of file ssl.cpp.
References des, DES_BLOCK, DES_EDE_KEY_SZ, key, and memcpy.
00902 { 00903 DES_EDE des; 00904 byte key[DES_EDE_KEY_SZ]; 00905 00906 memcpy(key, *ks1, DES_BLOCK); 00907 memcpy(&key[DES_BLOCK], *ks2, DES_BLOCK); 00908 memcpy(&key[DES_BLOCK * 2], *ks3, DES_BLOCK); 00909 00910 if (enc) { 00911 des.set_encryptKey(key, *ivec); 00912 des.encrypt(output, input, sz); 00913 } 00914 else { 00915 des.set_decryptKey(key, *ivec); 00916 des.decrypt(output, input, sz); 00917 } 00918 }
| int yaSSL::RAND_status | ( | void | ) |
| int yaSSL::DES_set_key | ( | const_DES_cblock * | key, | |
| DES_key_schedule * | schedule | |||
| ) |
| void yaSSL::DES_set_odd_parity | ( | DES_cblock * | key | ) |
| void yaSSL::DES_ecb_encrypt | ( | DES_cblock * | input, | |
| DES_cblock * | output, | |||
| DES_key_schedule * | key, | |||
| int | enc | |||
| ) |
Definition at line 941 of file ssl.cpp.
References des, and DES_BLOCK.
00943 { 00944 DES des; 00945 00946 if (enc) { 00947 des.set_encryptKey(*key, 0); 00948 des.encrypt(*output, *input, DES_BLOCK); 00949 } 00950 else { 00951 des.set_decryptKey(*key, 0); 00952 des.decrypt(*output, *input, DES_BLOCK); 00953 } 00954 }
| void yaSSL::SSL_CTX_set_default_passwd_cb_userdata | ( | SSL_CTX * | , | |
| void * | userdata | |||
| ) |
| void yaSSL::SSL_SESSION_free | ( | SSL_SESSION * | session | ) |
| void yaSSL::EVP_PKEY_free | ( | EVP_PKEY * | pkey | ) |
| void yaSSL::ERR_error_string_n | ( | unsigned long | e, | |
| char * | buf, | |||
| size_t | len | |||
| ) |
Definition at line 1005 of file ssl.cpp.
References ERR_error_string().
01006 { 01007 if (len) ERR_error_string(e, buf); 01008 }
Here is the call graph for this function:

| void yaSSL::ERR_free_strings | ( | void | ) |
| void yaSSL::EVP_cleanup | ( | void | ) |
| ASN1_TIME* yaSSL::X509_get_notBefore | ( | X509 * | x | ) |
| ASN1_TIME* yaSSL::X509_get_notAfter | ( | X509 * | x | ) |
| SSL_METHOD* yaSSL::SSLv23_client_method | ( | void | ) |
Definition at line 1037 of file ssl.cpp.
References SSLv3_client_method().
01038 { 01039 return SSLv3_client_method(); 01040 }
Here is the call graph for this function:

| SSL_METHOD* yaSSL::SSLv2_client_method | ( | void | ) |
| SSL_SESSION* yaSSL::SSL_get1_session | ( | SSL * | ssl | ) |
Definition at line 1049 of file ssl.cpp.
References SSL_get_session().
01050 { 01051 return SSL_get_session(ssl); 01052 }
Here is the call graph for this function:

| void yaSSL::GENERAL_NAMES_free | ( | STACK_OF(GENERAL_NAME)* | x | ) |
| int yaSSL::sk_GENERAL_NAME_num | ( | STACK_OF(GENERAL_NAME)* | x | ) |
| GENERAL_NAME* yaSSL::sk_GENERAL_NAME_value | ( | STACK_OF(GENERAL_NAME)* | x, | |
| int | i | |||
| ) |
| unsigned char* yaSSL::ASN1_STRING_data | ( | ASN1_STRING * | x | ) |
| int yaSSL::ASN1_STRING_length | ( | ASN1_STRING * | x | ) |
| int yaSSL::ASN1_STRING_type | ( | ASN1_STRING * | x | ) |
| int yaSSL::X509_NAME_get_index_by_NID | ( | X509_NAME * | name, | |
| int | nid, | |||
| int | lastpos | |||
| ) |
Definition at line 1096 of file ssl.cpp.
References name, NID_commonName, start(), and strstr().
01097 { 01098 int idx = -1; // not found 01099 const char* start = &name->GetName()[lastpos + 1]; 01100 01101 switch (nid) { 01102 case NID_commonName: 01103 const char* found = strstr(start, "/CN="); 01104 if (found) { 01105 found += 4; // advance to str 01106 idx = found - start + lastpos + 1; 01107 } 01108 break; 01109 } 01110 01111 return idx; 01112 }
Here is the call graph for this function:

| ASN1_STRING* yaSSL::X509_NAME_ENTRY_get_data | ( | X509_NAME_ENTRY * | ne | ) |
| X509_NAME_ENTRY* yaSSL::X509_NAME_get_entry | ( | X509_NAME * | name, | |
| int | loc | |||
| ) |
| int yaSSL::ASN1_STRING_to_UTF8 | ( | unsigned char ** | out, | |
| ASN1_STRING * | in | |||
| ) |
Definition at line 1129 of file ssl.cpp.
References ASN1_STRING::data, ASN1_STRING::length, malloc, and memcpy.
01130 { 01131 if (!in) return 0; 01132 01133 *out = (unsigned char*)malloc(in->length + 1); 01134 if (*out) { 01135 memcpy(*out, in->data, in->length); 01136 (*out)[in->length] = 0; 01137 } 01138 return in->length; 01139 }
| void* yaSSL::X509_get_ext_d2i | ( | X509 * | x, | |
| int | nid, | |||
| int * | crit, | |||
| int * | idx | |||
| ) |

