From 24c4a63e12354d797d0ab02d6b9bc2d9044f74b4 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Tue, 31 Mar 2009 23:51:48 +0000 Subject: [PATCH] Make FAST changes build when pkinit is disabled ticket: 6436 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22153 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/asn.1/asn1_k_decode.c | 3 ++- src/lib/krb5/asn.1/asn1_k_encode.c | 6 ++++-- src/lib/krb5/asn.1/krb5_decode.c | 20 ++++++++++---------- src/lib/krb5/asn.1/krb5_encode.c | 13 +++++++------ 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index c6857fe60..38fa1a229 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -2321,6 +2321,8 @@ error_out: return retval; } +#endif /* DISABLE_PKINIT */ + static void free_typed_data(void *dummy, krb5_typed_data *val) { free(val->data); @@ -2354,4 +2356,3 @@ asn1_decode_typed_data_ptr(asn1buf *buf, krb5_typed_data **valptr) { decode_ptr(krb5_typed_data *, asn1_decode_typed_data); } -#endif /* DISABLE_PKINIT */ diff --git a/src/lib/krb5/asn.1/asn1_k_encode.c b/src/lib/krb5/asn.1/asn1_k_encode.c index 53ce7fee1..efa75643d 100644 --- a/src/lib/krb5/asn.1/asn1_k_encode.c +++ b/src/lib/krb5/asn.1/asn1_k_encode.c @@ -1337,7 +1337,6 @@ MAKE_FULL_ENCODER(encode_krb5_fast_response, fast_response); -#ifndef DISABLE_PKINIT /* * PKINIT */ @@ -1439,6 +1438,8 @@ MAKE_FULL_ENCODER(encode_krb5_fast_response, fast_response); return retval; }\ sum += length; } +#ifndef DISABLE_PKINIT + /* Callable encoders for the types defined above, until the PKINIT encoders get converted. */ MAKE_ENCFN(asn1_encode_realm, realm_of_principal_data); @@ -1819,6 +1820,8 @@ asn1_error_code asn1_encode_td_trusted_certifiers(asn1buf *buf, const krb5_exter asn1_cleanup(); } +#endif /* DISABLE_PKINIT */ + asn1_error_code asn1_encode_sequence_of_typed_data(asn1buf *buf, const krb5_typed_data **val, unsigned int *retlen) { asn1_setup(); @@ -1847,4 +1850,3 @@ asn1_error_code asn1_encode_typed_data(asn1buf *buf, const krb5_typed_data *val, asn1_makeseq(); asn1_cleanup(); } -#endif /* DISABLE_PKINIT */ diff --git a/src/lib/krb5/asn.1/krb5_decode.c b/src/lib/krb5/asn.1/krb5_decode.c index 32d60915d..9080d97ec 100644 --- a/src/lib/krb5/asn.1/krb5_decode.c +++ b/src/lib/krb5/asn.1/krb5_decode.c @@ -1296,16 +1296,6 @@ decode_krb5_reply_key_pack_draft9(const krb5_data *code, cleanup(free); } -krb5_error_code -decode_krb5_typed_data(const krb5_data *code, krb5_typed_data ***repptr) -{ - setup_buf_only(krb5_typed_data **); - retval = asn1_decode_sequence_of_typed_data(&buf, &rep); - if (retval) clean_return(retval); - - cleanup(free); -} - krb5_error_code decode_krb5_td_trusted_certifiers(const krb5_data *code, krb5_external_principal_identifier ***repptr) @@ -1328,3 +1318,13 @@ decode_krb5_td_dh_parameters(const krb5_data *code, cleanup(free); } #endif /* DISABLE_PKINIT */ + +krb5_error_code +decode_krb5_typed_data(const krb5_data *code, krb5_typed_data ***repptr) +{ + setup_buf_only(krb5_typed_data **); + retval = asn1_decode_sequence_of_typed_data(&buf, &rep); + if (retval) clean_return(retval); + + cleanup(free); +} diff --git a/src/lib/krb5/asn.1/krb5_encode.c b/src/lib/krb5/asn.1/krb5_encode.c index a8ac06a54..5834e8ae8 100644 --- a/src/lib/krb5/asn.1/krb5_encode.c +++ b/src/lib/krb5/asn.1/krb5_encode.c @@ -34,7 +34,6 @@ /**************** Macros (these save a lot of typing) ****************/ -#ifndef DISABLE_PKINIT /* setup() -- create and initialize bookkeeping variables retval: stores error codes returned from subroutines buf: the coding buffer @@ -63,6 +62,7 @@ error:\ *code = tmpcode;\ return 0 +#ifndef DISABLE_PKINIT krb5_error_code encode_krb5_pa_pk_as_req(const krb5_pa_pk_as_req *rep, krb5_data **code) { krb5_setup(); @@ -153,21 +153,22 @@ krb5_error_code encode_krb5_td_trusted_certifiers(const krb5_external_principal_ krb5_cleanup(); } -krb5_error_code encode_krb5_typed_data(const krb5_typed_data **rep, krb5_data **code) +krb5_error_code encode_krb5_td_dh_parameters(const krb5_algorithm_identifier **rep, krb5_data **code) { krb5_setup(); - retval = asn1_encode_sequence_of_typed_data(buf,rep,&length); + retval = asn1_encode_sequence_of_algorithm_identifier(buf,rep,&length); if (retval) goto error; sum += length; krb5_cleanup(); } +#endif /* DISABLE_PKINIT */ -krb5_error_code encode_krb5_td_dh_parameters(const krb5_algorithm_identifier **rep, krb5_data **code) +krb5_error_code encode_krb5_typed_data(const krb5_typed_data **rep, krb5_data **code) { krb5_setup(); - retval = asn1_encode_sequence_of_algorithm_identifier(buf,rep,&length); + retval = asn1_encode_sequence_of_typed_data(buf,rep,&length); if (retval) goto error; sum += length; krb5_cleanup(); } -#endif /* DISABLE_PKINIT */ + -- 2.26.2