aboutsummaryrefslogtreecommitdiff
path: root/src/mint-lib/mint_api_context.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-09-27 20:32:30 +0200
committerChristian Grothoff <christian@grothoff.org>2015-09-27 20:32:30 +0200
commitbf8b9d1435a196c9b7c3293904da2a3baba7210a (patch)
treeb722367def8d35bff70938db77323de61efd0348 /src/mint-lib/mint_api_context.c
parenta67fefa9fbcf9774d277a9c94aeebdf78d2051d1 (diff)
parent1bfba318ec0f3393de2dfc66821dec6165eef90a (diff)
mention need to audit randomness of gamma
Diffstat (limited to 'src/mint-lib/mint_api_context.c')
-rw-r--r--src/mint-lib/mint_api_context.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mint-lib/mint_api_context.c b/src/mint-lib/mint_api_context.c
index 9beeef149..5a14b4a46 100644
--- a/src/mint-lib/mint_api_context.c
+++ b/src/mint-lib/mint_api_context.c
@@ -435,6 +435,29 @@ MAC_download_get_result (struct MAC_DownloadBuffer *db,
{
json_t *json;
json_error_t error;
+ char *ct;
+
+ if ( (CURLE_OK !=
+ curl_easy_getinfo (eh,
+ CURLINFO_CONTENT_TYPE,
+ &ct)) ||
+ (NULL == ct) ||
+ (0 != strcasecmp (ct,
+ "application/json")) )
+ {
+ /* No content type or explicitly not JSON, refuse to parse
+ (but keep response code) */
+ if (CURLE_OK !=
+ curl_easy_getinfo (eh,
+ CURLINFO_RESPONSE_CODE,
+ response_code))
+ {
+ /* unexpected error... */
+ GNUNET_break (0);
+ *response_code = 0;
+ }
+ return NULL;
+ }
json = NULL;
if (0 == db->eno)