From: Dariusz Michaluk Date: Mon, 18 Apr 2016 14:56:42 +0000 (+0200) Subject: yaca_seal_init() needs key length to generate EVP_CIPHER X-Git-Tag: accepted/tizen/common/20160810.161523~205 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e63a71279fe8fcdc74e66c7ca17c1056d610e15;p=platform%2Fcore%2Fsecurity%2Fyaca.git yaca_seal_init() needs key length to generate EVP_CIPHER Change-Id: I65f40910983d5d8928174807dbdc7c622eee70d8 --- diff --git a/api/yaca/seal.h b/api/yaca/seal.h index aa1a10b..a080247 100644 --- a/api/yaca/seal.h +++ b/api/yaca/seal.h @@ -46,12 +46,13 @@ extern "C" { /** * @brief yaca_seal_init Initializes an asymmetric encryption context. * - * @param[out] ctx Newly created context (must be freed with @see yaca_ctx_free). - * @param[in] pub_key Public key of the peer that will receive the encrypted data. - * @param[in] algo Symmetric algorithm that will be used. - * @param[in] bcm Block chaining mode for the symmetric algorithm. - * @param[out] sym_key Generated symmetric key that will be used. It is encrypted with peer's public key. - * @param[out] iv Generated initialization vector that will be used. + * @param[out] ctx Newly created context (must be freed with @see yaca_ctx_free). + * @param[in] pub_key Public key of the peer that will receive the encrypted data. + * @param[in] algo Symmetric algorithm that will be used. + * @param[in] bcm Block chaining mode for the symmetric algorithm. + * @param[in] sym_key_bits Symmetric key length (in bits) that will be generated. + * @param[out] sym_key Generated symmetric key that will be used. It is encrypted with peer's public key. + * @param[out] iv Generated initialization vector that will be used. * * @return 0 on success, negative on error (@see error.h). */ @@ -59,6 +60,7 @@ int yaca_seal_init(yaca_ctx_h *ctx, const yaca_key_h pub_key, yaca_enc_algo_e algo, yaca_block_cipher_mode_e bcm, + yaca_key_bits_e sym_key_bits, yaca_key_h *sym_key, yaca_key_h *iv); diff --git a/examples/seal.c b/examples/seal.c index a96dfd0..e2377a1 100644 --- a/examples/seal.c +++ b/examples/seal.c @@ -57,7 +57,7 @@ void encrypt_seal(void) size_t rem; ret = yaca_seal_init(&ctx, key_pub, - YACA_ENC_AES, YACA_BCM_CBC, + YACA_ENC_AES, YACA_BCM_CBC, YACA_KEY_192BIT, &aes_key, &iv); if (ret < 0) goto ex_pk; diff --git a/src/seal.c b/src/seal.c index fb5b50e..7b9308a 100644 --- a/src/seal.c +++ b/src/seal.c @@ -34,6 +34,7 @@ API int yaca_seal_init(yaca_ctx_h *ctx, const yaca_key_h pub_key, yaca_enc_algo_e algo, yaca_block_cipher_mode_e bcm, + yaca_key_bits_e sym_key_bits, yaca_key_h *sym_key, yaca_key_h *iv) {