From e61b83495e1a20e3661cd31fbd9d71899f6a2380 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 18 Apr 2015 00:51:43 +0200 Subject: implementing /test/encrypt --- src/mint/taler-mint-httpd_test.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/mint/taler-mint-httpd_test.h') diff --git a/src/mint/taler-mint-httpd_test.h b/src/mint/taler-mint-httpd_test.h index 5de63bb1..cafbb072 100644 --- a/src/mint/taler-mint-httpd_test.h +++ b/src/mint/taler-mint-httpd_test.h @@ -49,6 +49,31 @@ TMH_TEST_handler_test_base32 (struct TMH_RequestHandler *rh, size_t *upload_data_size); +/** + * Handle a "/test/encrypt" request. Parses the JSON in the post, + * runs the Crockford Base32 decoder on the "input" field in the JSON, + * and encrypts the result with a shared secret derived using the HKDF + * function with salt "skey" and IV derived with salt "iv" of the + * Crockford Base32-encoded "key_hash" field in the JSON. The + * symmetric encryption is the AES/Twofish double-encryption used in + * Taler/GNUnet. The resulting ciphertext is returned as a Crockford + * Base32 encoded JSON string. + * + * @param rh context of the handler + * @param connection the MHD connection to handle + * @param[in,out] connection_cls the connection's closure (can be updated) + * @param upload_data upload data + * @param[in,out] upload_data_size number of bytes (left) in @a upload_data + * @return MHD result code + */ +int +TMH_TEST_handler_test_encrypt (struct TMH_RequestHandler *rh, + struct MHD_Connection *connection, + void **connection_cls, + const char *upload_data, + size_t *upload_data_size); + + /** * Handle a "/test/hkdf" request. Parses the JSON in the post, runs * the Crockford Base32 decoder on the "input" field in the JSON, -- cgit v1.2.3