@@ -599,7 +599,7 @@
* @param src Buffer to digest. May not be NULL.
* @param src_len The length of the incoming buffer.
*/
-void md_ctx_update(md_ctx_t *ctx, const uint8_t *src, int src_len);
+void md_ctx_update(md_ctx_t *ctx, const uint8_t *src, size_t src_len);
/*
* Output the message digest to the given buffer.
@@ -765,6 +765,10 @@
return 1;
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
/*
*
* Generic message digest information functions
@@ -877,7 +881,7 @@
}
void
-md_ctx_update(mbedtls_md_context_t *ctx, const uint8_t *src, int src_len)
+md_ctx_update(mbedtls_md_context_t *ctx, const uint8_t *src, size_t src_len)
{
ASSERT(0 == mbedtls_md_update(ctx, src, src_len));
}
@@ -994,6 +998,11 @@
seed_len, output, output_len));
}
#else /* defined(HAVE_MBEDTLS_SSL_TLS_PRF) && defined(MBEDTLS_SSL_TLS_PRF_TLS1) */
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+
/*
* Generate the hash required by for the \c tls1_PRF function.
*
@@ -1122,10 +1131,10 @@
gc_free(&gc);
return true;
}
-#endif /* HAVE_MBEDTLS_SSL_TLS_PRF && defined(MBEDTLS_SSL_TLS_PRF_TLS1) */
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
+#endif /* HAVE_MBEDTLS_SSL_TLS_PRF && defined(MBEDTLS_SSL_TLS_PRF_TLS1) */
#endif /* ENABLE_CRYPTO_MBEDTLS */
@@ -1165,7 +1165,7 @@
}
void
-md_ctx_update(EVP_MD_CTX *ctx, const uint8_t *src, int src_len)
+md_ctx_update(EVP_MD_CTX *ctx, const uint8_t *src, size_t src_len)
{
EVP_DigestUpdate(ctx, src, src_len);
}
@@ -61,11 +61,6 @@
Hex[HASHHEXLEN] = '\0';
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
/* calculate H(A1) as per spec */
void
DigestCalcHA1(IN char *pszAlg, IN char *pszUserName, IN char *pszRealm, IN char *pszPassword,
@@ -150,8 +145,4 @@
CvtHex(RespHash, Response);
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
#endif /* if PROXY_DIGEST_AUTH */
@@ -772,6 +772,10 @@
return true;
}
+#if defined(__GNUC__) || defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
void
send_push_reply_auth_token(struct tls_multi *multi)
{
@@ -1046,7 +1050,7 @@
unsigned int *option_types_found, struct buffer *buf)
{
int ret = PUSH_MSG_ERROR;
- const uint8_t ch = buf_read_u8(buf);
+ const int ch = buf_read_u8(buf);
if (ch == ',')
{
struct buffer buf_orig = (*buf);
@@ -1090,10 +1094,6 @@
return ret;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
int
process_incoming_push_msg(struct context *c, const struct buffer *buffer,
bool honor_received_options, unsigned int permission_mask,