diff options
author | Simon Warta <[email protected]> | 2015-06-23 18:29:16 +0200 |
---|---|---|
committer | Simon Warta <[email protected]> | 2015-06-23 18:49:20 +0200 |
commit | e4cfc6684df02e1c1c2b583c764514cfc08e9c39 (patch) | |
tree | e8bc73070ddb9cb38594e114e28f4fa1129545f8 /src/lib/tls/tls_session.cpp | |
parent | fcb249320e9529c772fde21195659cc81cb57c73 (diff) |
lib/tls: Convert &vec[0] to vec.data()
Diffstat (limited to 'src/lib/tls/tls_session.cpp')
-rw-r--r-- | src/lib/tls/tls_session.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/tls/tls_session.cpp b/src/lib/tls/tls_session.cpp index 28cb8b420..8cb1a2aa7 100644 --- a/src/lib/tls/tls_session.cpp +++ b/src/lib/tls/tls_session.cpp @@ -50,7 +50,7 @@ Session::Session(const std::string& pem) { secure_vector<byte> der = PEM_Code::decode_check_label(pem, "TLS SESSION"); - *this = Session(&der[0], der.size()); + *this = Session(der.data(), der.size()); } Session::Session(const byte ber[], size_t ber_len) @@ -105,7 +105,7 @@ Session::Session(const byte ber[], size_t ber_len) if(!peer_cert_bits.empty()) { - DataSource_Memory certs(&peer_cert_bits[0], peer_cert_bits.size()); + DataSource_Memory certs(peer_cert_bits.data(), peer_cert_bits.size()); while(!certs.end_of_data()) m_peer_certs.push_back(X509_Certificate(certs)); @@ -169,7 +169,7 @@ Session::encrypt(const SymmetricKey& key, RandomNumberGenerator& rng) const secure_vector<byte> buf = nonce; buf += bits; - aead->start(&buf[0], nonce_len); + aead->start(buf.data(), nonce_len); aead->finish(buf, nonce_len); return unlock(buf); } @@ -194,7 +194,7 @@ Session Session::decrypt(const byte in[], size_t in_len, const SymmetricKey& key secure_vector<byte> buf(in + nonce_len, in + in_len); aead->finish(buf, 0); - return Session(&buf[0], buf.size()); + return Session(buf.data(), buf.size()); } catch(std::exception& e) { |