diff options
author | Luke Howard <lukeh@padl.com> | 2008-11-22 03:43:00 +0000 |
---|---|---|
committer | Luke Howard <lukeh@padl.com> | 2008-11-22 03:43:00 +0000 |
commit | ec6161a6727246f0844438ec8f635d8528bbcf0c (patch) | |
tree | 3a2ad099ef3fccb4588dd02fd9c177743e4ce9a1 | |
parent | cbbab235a37fcb978a7009543d1996a991a3ccf8 (diff) | |
download | krb5-ec6161a6727246f0844438ec8f635d8528bbcf0c.zip krb5-ec6161a6727246f0844438ec8f635d8528bbcf0c.tar.gz krb5-ec6161a6727246f0844438ec8f635d8528bbcf0c.tar.bz2 |
Add decode_krb5_setpw_req()
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/mskrb-integ@21173 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r-- | src/include/k5-int.h | 3 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode.c | 17 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode.h | 3 | ||||
-rw-r--r-- | src/lib/krb5/asn.1/krb5_decode.c | 14 | ||||
-rw-r--r-- | src/lib/krb5/libkrb5.exports | 1 |
5 files changed, 38 insertions, 0 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index c06b6b4..c966f0a 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1668,6 +1668,9 @@ krb5_error_code decode_krb5_pa_enc_ts krb5_error_code decode_krb5_sam_key (const krb5_data *, krb5_sam_key **); +krb5_error_code decode_krb5_setpw_req + (const krb5_data *, krb5_data **, krb5_principal *); + struct _krb5_key_data; /* kdb.h */ struct ldap_seqof_key_data { diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 2af3a00..485a8ce 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -1186,6 +1186,23 @@ asn1_error_code asn1_decode_predicted_sam_response(asn1buf *buf, krb5_predicted_ cleanup(); } +asn1_error_code asn1_decode_setpw_req(asn1buf *buf, krb5_data *rep, krb5_principal *principal) +{ + setup(); + *principal = NULL; + + { begin_structure(); + get_lenfield(rep->length, rep->data, 0, asn1_decode_charstring); + if (tagnum == 1) { + alloc_field(*principal, krb5_principal_data); + opt_field(*principal, 1, asn1_decode_principal_name, 0); + opt_field(*principal, 2, asn1_decode_realm, 0); + } + end_structure(); + } + cleanup(); +} + #ifndef DISABLE_PKINIT /* PKINIT */ diff --git a/src/lib/krb5/asn.1/asn1_k_decode.h b/src/lib/krb5/asn.1/asn1_k_decode.h index 8541a82..46ec31c 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.h +++ b/src/lib/krb5/asn.1/asn1_k_decode.h @@ -233,4 +233,7 @@ asn1_error_code asn1_decode_sequence_of_trusted_ca asn1_error_code asn1_decode_sequence_of_algorithm_identifier (asn1buf *buf, krb5_algorithm_identifier ***val); +asn1_error_code asn1_decode_setpw_req + (asn1buf *buf, krb5_data *rep, krb5_principal *principal); + #endif diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index ca0eb9e..7ff7886 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -949,6 +949,20 @@ krb5_error_code decode_krb5_predicted_sam_response(const krb5_data *code, krb5_p cleanup(free); } +krb5_error_code decode_krb5_setpw_req(const krb5_data *code, + krb5_data **rep, + krb5_principal *principal) +{ + setup_buf_only(); + alloc_field(*rep, krb5_data); + *principal = NULL; + + retval = asn1_decode_setpw_req(&buf, *rep, principal); + if (retval) clean_return(retval); + + cleanup(free); +} + #ifndef DISABLE_PKINIT krb5_error_code decode_krb5_pa_pk_as_req(const krb5_data *code, krb5_pa_pk_as_req **rep) { diff --git a/src/lib/krb5/libkrb5.exports b/src/lib/krb5/libkrb5.exports index 8cfdff8..adbc8a3 100644 --- a/src/lib/krb5/libkrb5.exports +++ b/src/lib/krb5/libkrb5.exports @@ -27,6 +27,7 @@ decode_krb5_pwd_sequence decode_krb5_safe decode_krb5_sam_challenge decode_krb5_sam_response +decode_krb5_setpw_req decode_krb5_tgs_rep decode_krb5_tgs_req decode_krb5_ticket |