diff options
author | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
---|---|---|
committer | HaoTNN <haotnn@gmail.com> | 2015-06-03 01:08:57 +0200 |
commit | 3142598dee31acc23c738a1a728638665c8940b8 (patch) | |
tree | 2eb837ed785678d536d677ff5020fabca089f2e5 /src/PolarSSL++/CryptoKey.cpp | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #2182 from birkett/master (diff) | |
download | cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.gz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.bz2 cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.lz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.xz cuberite-3142598dee31acc23c738a1a728638665c8940b8.tar.zst cuberite-3142598dee31acc23c738a1a728638665c8940b8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/PolarSSL++/CryptoKey.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/PolarSSL++/CryptoKey.cpp b/src/PolarSSL++/CryptoKey.cpp index 9354ddf50..cc4eefdfe 100644 --- a/src/PolarSSL++/CryptoKey.cpp +++ b/src/PolarSSL++/CryptoKey.cpp @@ -77,7 +77,7 @@ int cCryptoKey::Decrypt(const Byte * a_EncryptedData, size_t a_EncryptedLength, { return res; } - return (int)DecryptedLen; + return static_cast<int>(DecryptedLen); } @@ -97,7 +97,7 @@ int cCryptoKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a { return res; } - return (int)EncryptedLength; + return static_cast<int>(EncryptedLength); } @@ -109,7 +109,7 @@ int cCryptoKey::ParsePublic(const void * a_Data, size_t a_NumBytes) { ASSERT(!IsValid()); // Cannot parse a second key - return pk_parse_public_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes); + return pk_parse_public_key(&m_Pk, reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes); } @@ -123,14 +123,14 @@ int cCryptoKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AStri if (a_Password.empty()) { - return pk_parse_key(&m_Pk, (const unsigned char *)a_Data, a_NumBytes, nullptr, 0); + return pk_parse_key(&m_Pk, reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes, nullptr, 0); } else { return pk_parse_key( &m_Pk, - (const unsigned char *)a_Data, a_NumBytes, - (const unsigned char *)a_Password.c_str(), a_Password.size() + reinterpret_cast<const unsigned char *>(a_Data), a_NumBytes, + reinterpret_cast<const unsigned char *>(a_Password.c_str()), a_Password.size() ); } } |