diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-09-27 20:32:30 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-09-27 20:32:30 +0200 |
commit | bf8b9d1435a196c9b7c3293904da2a3baba7210a (patch) | |
tree | b722367def8d35bff70938db77323de61efd0348 /src/mint-lib/mint_api_context.c | |
parent | a67fefa9fbcf9774d277a9c94aeebdf78d2051d1 (diff) | |
parent | 1bfba318ec0f3393de2dfc66821dec6165eef90a (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.c | 23 |
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) |