Some last compiler warnings resolved

This commit is contained in:
Simon Rozman 2016-08-16 00:58:22 +02:00
parent 85d7c3d4ec
commit db27355e46
2 changed files with 11 additions and 1 deletions

View File

@ -131,6 +131,9 @@ DWORD WINAPI EapPeerGetInfo(_In_ EAP_TYPE* pEapType, _Out_ EAP_PEER_METHOD_ROUTI
}
#pragma warning(push)
#pragma warning(disable: 4702) // Compiler is smart enough to find out the initialize() method is empty => never throws an exception.
///
/// Initializes an EAP peer method for EAPHost.
///
@ -162,6 +165,11 @@ DWORD APIENTRY EapPeerInitialize(_Out_ EAP_ERROR **ppEapError)
return dwResult;
}
#pragma warning(pop)
#pragma warning(push)
#pragma warning(disable: 4702) // Compiler is smart enough to find out the shutdown() method is empty => never throws an exception.
///
/// Shuts down the EAP method and prepares to unload its corresponding DLL.
@ -194,6 +202,8 @@ DWORD APIENTRY EapPeerShutdown(_Out_ EAP_ERROR **ppEapError)
return dwResult;
}
#pragma warning(pop)
///
/// Returns the user data and user identity after being called by EAPHost.

View File

@ -1326,7 +1326,7 @@ void eap::method_tls::decrypt_message(_In_ tls_message_type_t type, _Inout_ sani
// Check padding. Do not throw until HMAC is calculated.
// [Canvel, B., "Password Interception in a SSL/TLS Channel"](http://lasecwww.epfl.ch/memo_ssl.shtml)
unsigned char padding = data.back();
size_data = padding + 1 <= size_data ? size_data - (padding + 1) : 0;
size_data = (size_t)padding + 1 <= size_data ? size_data - (padding + 1) : 0;
for (size_t i = size_data, i_end = data.size() - 1; i < i_end; i++)
if (data[i] != padding)
padding_ok = false;