Prefix der primitives with der_.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@18455 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -2690,7 +2690,7 @@ krb5_string_to_enctype(krb5_context context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
krb5_error_code KRB5_LIB_FUNCTION
|
krb5_error_code KRB5_LIB_FUNCTION
|
||||||
krb5_enctype_to_oid(krb5_context context,
|
_krb5_enctype_to_oid(krb5_context context,
|
||||||
krb5_enctype etype,
|
krb5_enctype etype,
|
||||||
heim_oid *oid)
|
heim_oid *oid)
|
||||||
{
|
{
|
||||||
@@ -2705,7 +2705,7 @@ krb5_enctype_to_oid(krb5_context context,
|
|||||||
return KRB5_PROG_ETYPE_NOSUPP;
|
return KRB5_PROG_ETYPE_NOSUPP;
|
||||||
}
|
}
|
||||||
krb5_clear_error_string(context);
|
krb5_clear_error_string(context);
|
||||||
return copy_oid(et->oid, oid);
|
return der_copy_oid(et->oid, oid);
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_error_code KRB5_LIB_FUNCTION
|
krb5_error_code KRB5_LIB_FUNCTION
|
||||||
@@ -2715,7 +2715,7 @@ _krb5_oid_to_enctype(krb5_context context,
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < num_etypes; i++) {
|
for(i = 0; i < num_etypes; i++) {
|
||||||
if(etypes[i]->oid && heim_oid_cmp(etypes[i]->oid, oid) == 0) {
|
if(etypes[i]->oid && der_heim_oid_cmp(etypes[i]->oid, oid) == 0) {
|
||||||
*etype = etypes[i]->type;
|
*etype = etypes[i]->type;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -110,7 +110,7 @@ krb5_copy_data(krb5_context context,
|
|||||||
krb5_set_error_string(context, "malloc: out of memory");
|
krb5_set_error_string(context, "malloc: out of memory");
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
}
|
}
|
||||||
ret = copy_octet_string(indata, *outdata);
|
ret = der_copy_octet_string(indata, *outdata);
|
||||||
if(ret) {
|
if(ret) {
|
||||||
krb5_clear_error_string (context);
|
krb5_clear_error_string (context);
|
||||||
free(*outdata);
|
free(*outdata);
|
||||||
|
@@ -790,7 +790,7 @@ krb5_digest_get_a1_hash(krb5_context context,
|
|||||||
krb5_data_zero(data);
|
krb5_data_zero(data);
|
||||||
if (digest->response.hash_a1 == NULL)
|
if (digest->response.hash_a1 == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
ret = copy_octet_string(digest->response.hash_a1, data);
|
ret = der_copy_octet_string(digest->response.hash_a1, data);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_clear_error_string(context);
|
krb5_clear_error_string(context);
|
||||||
|
|
||||||
|
@@ -98,7 +98,7 @@ krb5_c_get_checksum(krb5_context context, const krb5_checksum *cksum,
|
|||||||
if (*data == NULL)
|
if (*data == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
|
||||||
ret = copy_octet_string(&cksum->checksum, *data);
|
ret = der_copy_octet_string(&cksum->checksum, *data);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free(*data);
|
free(*data);
|
||||||
*data = NULL;
|
*data = NULL;
|
||||||
@@ -113,7 +113,7 @@ krb5_c_set_checksum(krb5_context context, krb5_checksum *cksum,
|
|||||||
krb5_cksumtype type, const krb5_data *data)
|
krb5_cksumtype type, const krb5_data *data)
|
||||||
{
|
{
|
||||||
cksum->cksumtype = type;
|
cksum->cksumtype = type;
|
||||||
return copy_octet_string(data, &cksum->checksum);
|
return der_copy_octet_string(data, &cksum->checksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KRB5_LIB_FUNCTION
|
void KRB5_LIB_FUNCTION
|
||||||
|
@@ -344,7 +344,7 @@ build_auth_pack(krb5_context context,
|
|||||||
ALLOC(a->clientPublicValue, 1);
|
ALLOC(a->clientPublicValue, 1);
|
||||||
if (a->clientPublicValue == NULL)
|
if (a->clientPublicValue == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
ret = copy_oid(oid_id_dhpublicnumber(),
|
ret = der_copy_oid(oid_id_dhpublicnumber(),
|
||||||
&a->clientPublicValue->algorithm.algorithm);
|
&a->clientPublicValue->algorithm.algorithm);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
@@ -392,7 +392,7 @@ build_auth_pack(krb5_context context,
|
|||||||
|
|
||||||
ASN1_MALLOC_ENCODE(DHPublicKey, dhbuf.data, dhbuf.length,
|
ASN1_MALLOC_ENCODE(DHPublicKey, dhbuf.data, dhbuf.length,
|
||||||
&dh_pub_key, &size, ret);
|
&dh_pub_key, &size, ret);
|
||||||
free_heim_integer(&dh_pub_key);
|
der_free_heim_integer(&dh_pub_key);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
if (size != dhbuf.length)
|
if (size != dhbuf.length)
|
||||||
@@ -413,7 +413,7 @@ _krb5_pk_mk_ContentInfo(krb5_context context,
|
|||||||
{
|
{
|
||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
|
|
||||||
ret = copy_oid(oid, &content_info->contentType);
|
ret = der_copy_oid(oid, &content_info->contentType);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
ALLOC(content_info->content, 1);
|
ALLOC(content_info->content, 1);
|
||||||
@@ -914,7 +914,7 @@ pk_rd_pa_reply_enckey(krb5_context context,
|
|||||||
krb5_data content;
|
krb5_data content;
|
||||||
heim_oid contentType = { 0, NULL };
|
heim_oid contentType = { 0, NULL };
|
||||||
|
|
||||||
if (heim_oid_cmp(oid_id_pkcs7_envelopedData(), &rep->contentType)) {
|
if (der_heim_oid_cmp(oid_id_pkcs7_envelopedData(), &rep->contentType)) {
|
||||||
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
@@ -950,7 +950,7 @@ pk_rd_pa_reply_enckey(krb5_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heim_oid_cmp(&ci.contentType, oid_id_pkcs7_signedData())) {
|
if (der_heim_oid_cmp(&ci.contentType, oid_id_pkcs7_signedData())) {
|
||||||
ret = EINVAL; /* XXX */
|
ret = EINVAL; /* XXX */
|
||||||
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
||||||
goto out;
|
goto out;
|
||||||
@@ -984,13 +984,13 @@ pk_rd_pa_reply_enckey(krb5_context context,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (type == COMPAT_WIN2K) {
|
if (type == COMPAT_WIN2K) {
|
||||||
if (heim_oid_cmp(&contentType, oid_id_pkcs7_data()) != 0) {
|
if (der_heim_oid_cmp(&contentType, oid_id_pkcs7_data()) != 0) {
|
||||||
krb5_set_error_string(context, "PKINIT: reply key, wrong oid");
|
krb5_set_error_string(context, "PKINIT: reply key, wrong oid");
|
||||||
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (heim_oid_cmp(&contentType, oid_id_pkrkeydata()) != 0) {
|
if (der_heim_oid_cmp(&contentType, oid_id_pkrkeydata()) != 0) {
|
||||||
krb5_set_error_string(context, "PKINIT: reply key, wrong oid");
|
krb5_set_error_string(context, "PKINIT: reply key, wrong oid");
|
||||||
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1016,7 +1016,7 @@ pk_rd_pa_reply_enckey(krb5_context context,
|
|||||||
out:
|
out:
|
||||||
if (host)
|
if (host)
|
||||||
_krb5_pk_cert_free(host);
|
_krb5_pk_cert_free(host);
|
||||||
free_oid(&contentType);
|
der_free_oid(&contentType);
|
||||||
krb5_data_free(&content);
|
krb5_data_free(&content);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -1048,7 +1048,7 @@ pk_rd_pa_reply_dh(krb5_context context,
|
|||||||
krb5_data_zero(&content);
|
krb5_data_zero(&content);
|
||||||
memset(&kdc_dh_info, 0, sizeof(kdc_dh_info));
|
memset(&kdc_dh_info, 0, sizeof(kdc_dh_info));
|
||||||
|
|
||||||
if (heim_oid_cmp(oid_id_pkcs7_signedData(), &rep->contentType)) {
|
if (der_heim_oid_cmp(oid_id_pkcs7_signedData(), &rep->contentType)) {
|
||||||
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
krb5_set_error_string(context, "PKINIT: Invalid content type");
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
@@ -1073,7 +1073,7 @@ pk_rd_pa_reply_dh(krb5_context context,
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (heim_oid_cmp(&contentType, oid_id_pkdhkeydata())) {
|
if (der_heim_oid_cmp(&contentType, oid_id_pkdhkeydata())) {
|
||||||
krb5_set_error_string(context, "pkinit - dh reply contains wrong oid");
|
krb5_set_error_string(context, "pkinit - dh reply contains wrong oid");
|
||||||
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1613,9 +1613,9 @@ _krb5_parse_moduli_line(krb5_context context,
|
|||||||
return 0;
|
return 0;
|
||||||
out:
|
out:
|
||||||
free(m1->name);
|
free(m1->name);
|
||||||
free_heim_integer(&m1->p);
|
der_free_heim_integer(&m1->p);
|
||||||
free_heim_integer(&m1->g);
|
der_free_heim_integer(&m1->g);
|
||||||
free_heim_integer(&m1->q);
|
der_free_heim_integer(&m1->q);
|
||||||
free(m1);
|
free(m1);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1626,9 +1626,9 @@ _krb5_free_moduli(struct krb5_dh_moduli **moduli)
|
|||||||
int i;
|
int i;
|
||||||
for (i = 0; moduli[i] != NULL; i++) {
|
for (i = 0; moduli[i] != NULL; i++) {
|
||||||
free(moduli[i]->name);
|
free(moduli[i]->name);
|
||||||
free_heim_integer(&moduli[i]->p);
|
der_free_heim_integer(&moduli[i]->p);
|
||||||
free_heim_integer(&moduli[i]->g);
|
der_free_heim_integer(&moduli[i]->g);
|
||||||
free_heim_integer(&moduli[i]->q);
|
der_free_heim_integer(&moduli[i]->q);
|
||||||
free(moduli[i]);
|
free(moduli[i]);
|
||||||
}
|
}
|
||||||
free(moduli);
|
free(moduli);
|
||||||
@@ -1737,9 +1737,9 @@ _krb5_dh_group_ok(krb5_context context, unsigned long bits,
|
|||||||
*name = NULL;
|
*name = NULL;
|
||||||
|
|
||||||
for (i = 0; moduli[i] != NULL; i++) {
|
for (i = 0; moduli[i] != NULL; i++) {
|
||||||
if (heim_integer_cmp(&moduli[i]->g, g) == 0 &&
|
if (der_heim_integer_cmp(&moduli[i]->g, g) == 0 &&
|
||||||
heim_integer_cmp(&moduli[i]->p, p) == 0 &&
|
der_heim_integer_cmp(&moduli[i]->p, p) == 0 &&
|
||||||
(q == NULL || heim_integer_cmp(&moduli[i]->q, q) == 0))
|
(q == NULL || der_heim_integer_cmp(&moduli[i]->q, q) == 0))
|
||||||
{
|
{
|
||||||
if (bits && bits > moduli[i]->bits) {
|
if (bits && bits > moduli[i]->bits) {
|
||||||
krb5_set_error_string(context, "PKINIT: DH group parameter %s "
|
krb5_set_error_string(context, "PKINIT: DH group parameter %s "
|
||||||
|
@@ -124,7 +124,7 @@ find_type_in_ad(krb5_context context,
|
|||||||
*/
|
*/
|
||||||
for (i = 0; i < ad->len; i++) {
|
for (i = 0; i < ad->len; i++) {
|
||||||
if (!*found && ad->val[i].ad_type == type) {
|
if (!*found && ad->val[i].ad_type == type) {
|
||||||
ret = copy_octet_string(&ad->val[i].ad_data, data);
|
ret = der_copy_octet_string(&ad->val[i].ad_data, data);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_set_error_string(context, "malloc - out of memory");
|
krb5_set_error_string(context, "malloc - out of memory");
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user