(const krb5_data *, krb5_sam_key **);
struct _krb5_key_data; /* kdb.h */
+
+struct ldap_seqof_key_data {
+ krb5_int32 mkvno; /* Master key version number */
+ struct _krb5_key_data *key_data;
+ krb5_int16 n_key_data;
+};
+typedef struct ldap_seqof_key_data ldap_seqof_key_data;
+
krb5_error_code
-krb5int_ldap_encode_sequence_of_keys (struct _krb5_key_data *key_data,
- krb5_int16 n_key_data,
- krb5_int32 mkvno,
+krb5int_ldap_encode_sequence_of_keys (ldap_seqof_key_data *val,
krb5_data **code);
krb5_error_code
krb5int_ldap_decode_sequence_of_keys (krb5_data *in,
- struct _krb5_key_data **out,
- krb5_int16 *n_key_data,
- int *mkvno);
+ ldap_seqof_key_data **rep);
/*************************************************************************
* End of prototypes for krb5_decode.c
/* Used for KDB LDAP back end. */
krb5_error_code
- (*asn1_ldap_encode_sequence_of_keys) (struct _krb5_key_data *key_data,
- krb5_int16 n_key_data,
- krb5_int32 mkvno,
+ (*asn1_ldap_encode_sequence_of_keys) (ldap_seqof_key_data *val,
krb5_data **code);
krb5_error_code
(*asn1_ldap_decode_sequence_of_keys) (krb5_data *in,
- struct _krb5_key_data **out,
- krb5_int16 *n_key_data,
- int *mkvno);
+ ldap_seqof_key_data **);
/*
* pkinit asn.1 encode/decode functions
/* Major version and minor version are both '1' - first version */
/* asn1_error_code asn1_encode_sequence_of_keys (krb5_key_data *key_data, */
krb5_error_code
-asn1_encode_sequence_of_keys (krb5_key_data *key_data,
- krb5_int16 n_key_data,
- krb5_int32 mkvno, /* Master key version number */
- krb5_data **code)
+asn1_encode_sequence_of_keys (ldap_seqof_key_data *val, krb5_data **code)
{
+ krb5_key_data *key_data = val->key_data;
+ krb5_int16 n_key_data = val->n_key_data;
+ krb5_int32 mkvno = val->mkvno;
asn1_error_code ret = 0;
asn1buf *buf = NULL;
unsigned int length, sum = 0;
/* asn1_error_code asn1_decode_sequence_of_keys (krb5_data *in, */
krb5_error_code asn1_decode_sequence_of_keys (krb5_data *in,
- krb5_key_data **out,
- krb5_int16 *n_key_data,
- int *mkvno)
+ ldap_seqof_key_data **rep)
{
+ ldap_seqof_key_data *repval;
+ krb5_key_data **out;
+ krb5_int16 *n_key_data;
+ int *mkvno;
+
asn1_error_code ret;
asn1buf buf, subbuf;
int seqindef;
int kvno, maj, min;
long lval;
+ repval = calloc(1,sizeof(ldap_seqof_key_data));
+ *rep = repval;
+ out = &repval->key_data;
+ n_key_data = &repval->n_key_data;
+ mkvno = &repval->mkvno;
+
*n_key_data = 0;
*out = NULL;
krb5_int32 mkvno, krb5_data **code)
{
krb5_error_code err;
+ ldap_seqof_key_data val;
/*
* This should be pushed back into other library initialization
if (err)
return err;
- return accessor.asn1_ldap_encode_sequence_of_keys(key_data, n_key_data,
- mkvno, code);
+ val.key_data = key_data;
+ val.n_key_data = n_key_data;
+ val.mkvno = mkvno;
+
+ return accessor.asn1_ldap_encode_sequence_of_keys(&val, code);
}
static krb5_error_code
krb5_int16 *n_key_data, int *mkvno)
{
krb5_error_code err;
+ ldap_seqof_key_data *p;
/*
* This should be pushed back into other library initialization
if (err)
return err;
- return accessor.asn1_ldap_decode_sequence_of_keys(in, out, n_key_data,
- mkvno);
+ err = accessor.asn1_ldap_decode_sequence_of_keys(in, &p);
+ if (err)
+ return err;
+ *out = p->key_data;
+ *n_key_data = p->n_key_data;
+ *mkvno = p->mkvno;
+ free(p);
+ return 0;
}