diff options
author | lloyd <[email protected]> | 2010-10-15 13:17:04 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-10-15 13:17:04 +0000 |
commit | f7b299b7ecc684754da2959366d8895ab621d430 (patch) | |
tree | f9f7bd0ef94dbb8945e977edf252e8fcb52c7781 /src/ssl/tls_server.cpp | |
parent | 01e0b5f9e0a6572e8eea8f7e226eb96e11c0fa58 (diff) |
Use size_t in ssl
Diffstat (limited to 'src/ssl/tls_server.cpp')
-rw-r--r-- | src/ssl/tls_server.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ssl/tls_server.cpp b/src/ssl/tls_server.cpp index 1503912d0..8a5cefa02 100644 --- a/src/ssl/tls_server.cpp +++ b/src/ssl/tls_server.cpp @@ -141,7 +141,7 @@ std::vector<X509_Certificate> TLS_Server::peer_cert_chain() const /** * Write to a TLS connection */ -void TLS_Server::write(const byte buf[], u32bit length) +void TLS_Server::write(const byte buf[], size_t length) { if(!active) throw Internal_Error("TLS_Server::write called while closed"); @@ -152,7 +152,7 @@ void TLS_Server::write(const byte buf[], u32bit length) /** * Read from a TLS connection */ -u32bit TLS_Server::read(byte out[], u32bit length) +size_t TLS_Server::read(byte out[], size_t length) { if(!active) throw Internal_Error("TLS_Server::read called while closed"); @@ -166,7 +166,7 @@ u32bit TLS_Server::read(byte out[], u32bit length) break; } - u32bit got = std::min<size_t>(read_buf.size(), length); + size_t got = std::min<size_t>(read_buf.size(), length); read_buf.read(out, got); return got; } @@ -213,12 +213,12 @@ void TLS_Server::state_machine() byte rec_type = CONNECTION_CLOSED; SecureVector<byte> record(1024); - u32bit bytes_needed = reader.get_record(rec_type, record); + size_t bytes_needed = reader.get_record(rec_type, record); while(bytes_needed) { - u32bit to_get = std::min<u32bit>(record.size(), bytes_needed); - u32bit got = peer.read(&record[0], to_get); + size_t to_get = std::min<size_t>(record.size(), bytes_needed); + size_t got = peer.read(&record[0], to_get); if(got == 0) { @@ -289,7 +289,7 @@ void TLS_Server::read_handshake(byte rec_type, byte head[4] = { 0 }; state->queue.peek(head, 4); - const u32bit length = make_u32bit(0, head[1], head[2], head[3]); + const size_t length = make_u32bit(0, head[1], head[2], head[3]); if(state->queue.size() >= length + 4) { @@ -338,8 +338,8 @@ void TLS_Server::process_handshake_msg(Handshake_Type type, { state->hash.update(static_cast<byte>(type)); u32bit record_length = contents.size(); - for(u32bit j = 0; j != 3; j++) - state->hash.update(get_byte(j+1, record_length)); + for(size_t i = 0; i != 3; i++) + state->hash.update(get_byte(i+1, record_length)); } state->hash.update(contents); @@ -450,8 +450,8 @@ void TLS_Server::process_handshake_msg(Handshake_Type type, state->hash.update(static_cast<byte>(type)); u32bit record_length = contents.size(); - for(u32bit j = 0; j != 3; j++) - state->hash.update(get_byte(j+1, record_length)); + for(size_t i = 0; i != 3; i++) + state->hash.update(get_byte(i+1, record_length)); state->hash.update(contents); writer.send(CHANGE_CIPHER_SPEC, 1); |