return retval;
}
+#endif /* DISABLE_PKINIT */
+
static void free_typed_data(void *dummy, krb5_typed_data *val)
{
free(val->data);
{
decode_ptr(krb5_typed_data *, asn1_decode_typed_data);
}
-#endif /* DISABLE_PKINIT */
-#ifndef DISABLE_PKINIT
/*
* PKINIT
*/
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);
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();
asn1_makeseq();
asn1_cleanup();
}
-#endif /* DISABLE_PKINIT */
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)
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);
+}
/**************** 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
*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();
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 */
+