Update prototypes changes for hx509_crypto_[gs]et_params.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@17068 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -137,12 +137,14 @@ hx509_cms_unenvelope(hx509_context context,
|
|||||||
AlgorithmIdentifier *ai;
|
AlgorithmIdentifier *ai;
|
||||||
heim_octet_string *enccontent;
|
heim_octet_string *enccontent;
|
||||||
heim_octet_string *params, params_data;
|
heim_octet_string *params, params_data;
|
||||||
|
heim_octet_string ivec;
|
||||||
size_t size;
|
size_t size;
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
|
|
||||||
memset(&key, 0, sizeof(key));
|
memset(&key, 0, sizeof(key));
|
||||||
memset(&ed, 0, sizeof(ed));
|
memset(&ed, 0, sizeof(ed));
|
||||||
|
memset(&ivec, 0, sizeof(ivec));
|
||||||
memset(content, 0, sizeof(*content));
|
memset(content, 0, sizeof(*content));
|
||||||
memset(contentType, 0, sizeof(*contentType));
|
memset(contentType, 0, sizeof(*contentType));
|
||||||
|
|
||||||
@@ -204,33 +206,33 @@ hx509_cms_unenvelope(hx509_context context,
|
|||||||
|
|
||||||
{
|
{
|
||||||
hx509_crypto crypto;
|
hx509_crypto crypto;
|
||||||
heim_octet_string *ivec = NULL, ivec_data;
|
|
||||||
|
|
||||||
ret = hx509_crypto_init(context, NULL, &ai->algorithm, &crypto);
|
ret = hx509_crypto_init(context, NULL, &ai->algorithm, &crypto);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
if (params) {
|
||||||
|
ret = hx509_crypto_set_params(context, crypto, params, &ivec);
|
||||||
|
if (ret)
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret = hx509_crypto_set_key_data(crypto, key.data, key.length);
|
ret = hx509_crypto_set_key_data(crypto, key.data, key.length);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (params) {
|
|
||||||
ret = hx509_crypto_set_params(crypto, params, &ivec_data);
|
|
||||||
ivec = &ivec_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = hx509_crypto_decrypt(crypto,
|
ret = hx509_crypto_decrypt(crypto,
|
||||||
enccontent->data,
|
enccontent->data,
|
||||||
enccontent->length,
|
enccontent->length,
|
||||||
ivec,
|
ivec.length ? &ivec : NULL,
|
||||||
content);
|
content);
|
||||||
if (ivec)
|
|
||||||
free_octet_string(&ivec_data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
|
||||||
free_octet_string(&key);
|
free_octet_string(&key);
|
||||||
|
if (ivec.length)
|
||||||
|
free_octet_string(&ivec);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free_oid(contentType);
|
free_oid(contentType);
|
||||||
free_octet_string(content);
|
free_octet_string(content);
|
||||||
@@ -301,7 +303,8 @@ hx509_cms_envelope_1(hx509_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = hx509_crypto_get_params(crypto,
|
ret = hx509_crypto_get_params(context,
|
||||||
|
crypto,
|
||||||
&ivec,
|
&ivec,
|
||||||
enc_alg->parameters);
|
enc_alg->parameters);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user