winpr: Fix compile error after #3615

This commit is contained in:
Martin Fleisz 2016-11-25 11:50:28 +01:00
parent 3e6c54f9bd
commit 971c8538ec

View File

@ -235,11 +235,17 @@ BOOL winpr_HMAC_Update(WINPR_HMAC_CTX* ctx, const BYTE* input, size_t ilen)
BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen) BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen)
{ {
#if defined(WITH_OPENSSL)
HMAC_CTX* hmac;
#elif defined(WITH_MBEDTLS)
mbedtls_md_context_t* mdctx;
#endif
if (!ctx) if (!ctx)
return FALSE; return FALSE;
#if defined(WITH_OPENSSL) #if defined(WITH_OPENSSL)
HMAC_CTX* hmac = (HMAC_CTX*) ctx; hmac = (HMAC_CTX*) ctx;
#if (OPENSSL_VERSION_NUMBER < 0x10000000L) #if (OPENSSL_VERSION_NUMBER < 0x10000000L)
HMAC_Final(hmac, output, NULL); /* no return value on OpenSSL 0.9.x */ HMAC_Final(hmac, output, NULL); /* no return value on OpenSSL 0.9.x */
return TRUE; return TRUE;
@ -249,7 +255,7 @@ BOOL winpr_HMAC_Final(WINPR_HMAC_CTX* ctx, BYTE* output, size_t olen)
#endif #endif
#elif defined(WITH_MBEDTLS) #elif defined(WITH_MBEDTLS)
mbedtls_md_context_t* mdctx = (mbedtls_md_context_t*) ctx; mdctx = (mbedtls_md_context_t*) ctx;
if (mbedtls_md_hmac_finish(mdctx, output) == 0) if (mbedtls_md_hmac_finish(mdctx, output) == 0)
return TRUE; return TRUE;
#endif #endif