diff options
Diffstat (limited to 'src/include/pkinit_asn1.h')
-rw-r--r-- | src/include/pkinit_asn1.h | 85 |
1 files changed, 43 insertions, 42 deletions
diff --git a/src/include/pkinit_asn1.h b/src/include/pkinit_asn1.h index 8e33a69a60..44b01e9664 100644 --- a/src/include/pkinit_asn1.h +++ b/src/include/pkinit_asn1.h @@ -1,3 +1,4 @@ +/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright (c) 2004-2008 Apple Inc. All Rights Reserved. * @@ -29,7 +30,7 @@ * Created 18 May 2004 by Doug Mitchell. */ -#ifndef _PKINIT_ASN1_H_ +#ifndef _PKINIT_ASN1_H_ #define _PKINIT_ASN1_H_ #include <krb5/krb5.h> @@ -40,31 +41,31 @@ extern "C" { /* RFC 3280 AlgorithmIdentifier */ typedef struct { - krb5_data algorithm; /* OID */ - krb5_data parameters; /* ASN_ANY, defined by algorithm */ + krb5_data algorithm; /* OID */ + krb5_data parameters; /* ASN_ANY, defined by algorithm */ } krb5int_algorithm_id; /* * Encode and decode AuthPack, public key version (no Diffie-Hellman components). */ krb5_error_code krb5int_pkinit_auth_pack_encode( - krb5_timestamp kctime, - krb5_int32 cusec, /* microseconds */ - krb5_ui_4 nonce, - const krb5_checksum *pa_checksum, - const krb5int_algorithm_id *cms_types, /* optional */ - krb5_ui_4 num_cms_types, - krb5_data *auth_pack); /* mallocd and RETURNED */ + krb5_timestamp kctime, + krb5_int32 cusec, /* microseconds */ + krb5_ui_4 nonce, + const krb5_checksum *pa_checksum, + const krb5int_algorithm_id *cms_types, /* optional */ + krb5_ui_4 num_cms_types, + krb5_data *auth_pack); /* mallocd and RETURNED */ /* all returned values are optional - pass NULL if you don't want them */ krb5_error_code krb5int_pkinit_auth_pack_decode( - const krb5_data *auth_pack, /* DER encoded */ - krb5_timestamp *kctime, /* RETURNED */ - krb5_ui_4 *cusec, /* microseconds, RETURNED */ - krb5_ui_4 *nonce, /* RETURNED */ - krb5_checksum *pa_checksum, /* contents mallocd and RETURNED */ - krb5int_algorithm_id **cms_types, /* mallocd and RETURNED */ - krb5_ui_4 *num_cms_types); /* RETURNED */ + const krb5_data *auth_pack, /* DER encoded */ + krb5_timestamp *kctime, /* RETURNED */ + krb5_ui_4 *cusec, /* microseconds, RETURNED */ + krb5_ui_4 *nonce, /* RETURNED */ + krb5_checksum *pa_checksum, /* contents mallocd and RETURNED */ + krb5int_algorithm_id **cms_types, /* mallocd and RETURNED */ + krb5_ui_4 *num_cms_types); /* RETURNED */ /* @@ -72,7 +73,7 @@ krb5_error_code krb5int_pkinit_auth_pack_decode( * IssuerAndSerialNumber. */ krb5_error_code krb5int_pkinit_issuer_serial_encode( - const krb5_data *issuer, /* DER encoded */ + const krb5_data *issuer, /* DER encoded */ const krb5_data *serial_num, krb5_data *issuer_and_serial); /* content mallocd and RETURNED */ @@ -81,8 +82,8 @@ krb5_error_code krb5int_pkinit_issuer_serial_encode( */ krb5_error_code krb5int_pkinit_issuer_serial_decode( const krb5_data *issuer_and_serial, /* DER encoded */ - krb5_data *issuer, /* DER encoded, RETURNED */ - krb5_data *serial_num); /* RETURNED */ + krb5_data *issuer, /* DER encoded, RETURNED */ + krb5_data *serial_num); /* RETURNED */ /* * Top-level encode for PA-PK-AS-REQ. @@ -90,12 +91,12 @@ krb5_error_code krb5int_pkinit_issuer_serial_decode( * specific tag 0, during encode. */ krb5_error_code krb5int_pkinit_pa_pk_as_req_encode( - const krb5_data *signed_auth_pack, /* DER encoded ContentInfo */ - const krb5_data *trusted_CAs, /* optional: trustedCertifiers. Contents are - * DER-encoded issuer/serialNumbers. */ - krb5_ui_4 num_trusted_CAs, - const krb5_data *kdc_cert, /* optional kdcPkId, DER encoded issuer/serial */ - krb5_data *pa_pk_as_req); /* mallocd and RETURNED */ + const krb5_data *signed_auth_pack, /* DER encoded ContentInfo */ + const krb5_data *trusted_CAs, /* optional: trustedCertifiers. Contents are + * DER-encoded issuer/serialNumbers. */ + krb5_ui_4 num_trusted_CAs, + const krb5_data *kdc_cert, /* optional kdcPkId, DER encoded issuer/serial */ + krb5_data *pa_pk_as_req); /* mallocd and RETURNED */ /* * Top-level decode for PA-PK-AS-REQ. Does not perform cert verification on the @@ -105,15 +106,15 @@ krb5_error_code krb5int_pkinit_pa_pk_as_req_encode( */ krb5_error_code krb5int_pkinit_pa_pk_as_req_decode( const krb5_data *pa_pk_as_req, - krb5_data *signed_auth_pack, /* DER encoded ContentInfo, RETURNED */ + krb5_data *signed_auth_pack, /* DER encoded ContentInfo, RETURNED */ /* * Remainder are optionally RETURNED (specify NULL for pointers to * items you're not interested in). */ - krb5_ui_4 *num_trusted_CAs, /* sizeof trusted_CAs */ - krb5_data **trusted_CAs, /* mallocd array of DER-encoded TrustedCAs - * issuer/serial */ - krb5_data *kdc_cert); /* DER encoded issuer/serial */ + krb5_ui_4 *num_trusted_CAs, /* sizeof trusted_CAs */ + krb5_data **trusted_CAs, /* mallocd array of DER-encoded TrustedCAs + * issuer/serial */ + krb5_data *kdc_cert); /* DER encoded issuer/serial */ /* * Encode a ReplyKeyPack. The result is used as the Content of a SignedData. @@ -121,15 +122,15 @@ krb5_error_code krb5int_pkinit_pa_pk_as_req_decode( krb5_error_code krb5int_pkinit_reply_key_pack_encode( const krb5_keyblock *key_block, const krb5_checksum *checksum, - krb5_data *reply_key_pack); /* mallocd and RETURNED */ + krb5_data *reply_key_pack); /* mallocd and RETURNED */ /* * Decode a ReplyKeyPack. */ krb5_error_code krb5int_pkinit_reply_key_pack_decode( - const krb5_data *reply_key_pack, - krb5_keyblock *key_block, /* RETURNED */ - krb5_checksum *checksum); /* contents mallocd and RETURNED */ + const krb5_data *reply_key_pack, + krb5_keyblock *key_block, /* RETURNED */ + krb5_checksum *checksum); /* contents mallocd and RETURNED */ /* * Encode a PA-PK-AS-REP. @@ -141,8 +142,8 @@ krb5_error_code krb5int_pkinit_reply_key_pack_decode( */ krb5_error_code krb5int_pkinit_pa_pk_as_rep_encode( const krb5_data *dh_signed_data, - const krb5_data *enc_key_pack, /* EnvelopedData(signedData(ReplyKeyPack) */ - krb5_data *pa_pk_as_rep); /* mallocd and RETURNED */ + const krb5_data *enc_key_pack, /* EnvelopedData(signedData(ReplyKeyPack) */ + krb5_data *pa_pk_as_rep); /* mallocd and RETURNED */ /* * Decode a PA-PK-AS-REP. @@ -155,18 +156,18 @@ krb5_error_code krb5int_pkinit_pa_pk_as_rep_encode( */ krb5_error_code krb5int_pkinit_pa_pk_as_rep_decode( const krb5_data *pa_pk_as_rep, - krb5_data *dh_signed_data, - krb5_data *enc_key_pack); + krb5_data *dh_signed_data, + krb5_data *enc_key_pack); /* * Given a DER encoded certificate, obtain the associated IssuerAndSerialNumber. */ krb5_error_code krb5int_pkinit_get_issuer_serial( - const krb5_data *cert, - krb5_data *issuer_and_serial); + const krb5_data *cert, + krb5_data *issuer_and_serial); #ifdef __cplusplus } #endif -#endif /* _PKINIT_ASN1_H_ */ +#endif /* _PKINIT_ASN1_H_ */ |