Lines Matching refs:val

351 asn1_error_code asn1_decode_kerberos_time(asn1buf *buf, krb5_timestamp *val)  in asn1_decode_kerberos_time()  argument
360 *val = t; in asn1_decode_kerberos_time()
365 asn1_error_code fname(asn1buf * buf, ktype * val)\
371 *val = (ktype)n;\
375 asn1_error_code fname(asn1buf * buf, ktype * val)\
381 *val = (ktype)n;\
395 asn1_error_code asn1_decode_seqnum(asn1buf *buf, krb5_ui_4 *val) in integer_convert()
402 *val = (krb5_ui_4)n & 0xffffffff; in integer_convert()
406 asn1_error_code asn1_decode_msgtype(asn1buf *buf, krb5_msgtype *val) in asn1_decode_msgtype() argument
414 *val = (krb5_msgtype) n; in asn1_decode_msgtype()
420 asn1_error_code asn1_decode_realm(asn1buf *buf, krb5_principal *val) in asn1_decode_realm() argument
423 &((*val)->realm.length), in asn1_decode_realm()
424 &((*val)->realm.data)); in asn1_decode_realm()
427 asn1_error_code asn1_decode_principal_name(asn1buf *buf, krb5_principal *val) in asn1_decode_principal_name() argument
431 get_field((*val)->type,0,asn1_decode_int32); in asn1_decode_principal_name()
436 if ((*val)->data == NULL) in asn1_decode_principal_name()
437 (*val)->data = (krb5_data*)malloc(size*sizeof(krb5_data)); in asn1_decode_principal_name()
439 (*val)->data = (krb5_data*)realloc((*val)->data, in asn1_decode_principal_name()
441 if((*val)->data == NULL) return ENOMEM; in asn1_decode_principal_name()
443 &((*val)->data[size-1].length), in asn1_decode_principal_name()
444 &((*val)->data[size-1].data)); in asn1_decode_principal_name()
447 (*val)->length = size; in asn1_decode_principal_name()
455 (*val)->magic = KV5M_PRINCIPAL; in asn1_decode_principal_name()
460 asn1_error_code asn1_decode_checksum(asn1buf *buf, krb5_checksum *val) in asn1_decode_checksum() argument
464 get_field(val->checksum_type,0,asn1_decode_cksumtype); in asn1_decode_checksum()
465 get_lenfield(val->length,val->contents,1,asn1_decode_octetstring); in asn1_decode_checksum()
467 val->magic = KV5M_CHECKSUM; in asn1_decode_checksum()
472 asn1_error_code asn1_decode_encryption_key(asn1buf *buf, krb5_keyblock *val) in asn1_decode_encryption_key() argument
476 get_field(val->enctype,0,asn1_decode_enctype); in asn1_decode_encryption_key()
477 get_lenfield(val->length,val->contents,1,asn1_decode_octetstring); in asn1_decode_encryption_key()
479 val->magic = KV5M_KEYBLOCK; in asn1_decode_encryption_key()
484 asn1_error_code asn1_decode_encrypted_data(asn1buf *buf, krb5_enc_data *val) in asn1_decode_encrypted_data() argument
488 get_field(val->enctype,0,asn1_decode_enctype); in asn1_decode_encrypted_data()
489 opt_field(val->kvno,1,asn1_decode_kvno,0); in asn1_decode_encrypted_data()
490 get_lenfield(val->ciphertext.length,val->ciphertext.data,2,asn1_decode_charstring); in asn1_decode_encrypted_data()
492 val->magic = KV5M_ENC_DATA; in asn1_decode_encrypted_data()
497 asn1_error_code asn1_decode_krb5_flags(asn1buf *buf, krb5_flags *val) in asn1_decode_krb5_flags() argument
534 *val = f; in asn1_decode_krb5_flags()
538 asn1_error_code asn1_decode_ticket_flags(asn1buf *buf, krb5_flags *val) in asn1_decode_ticket_flags() argument
539 { return asn1_decode_krb5_flags(buf,val); } in asn1_decode_ticket_flags()
541 asn1_error_code asn1_decode_ap_options(asn1buf *buf, krb5_flags *val) in asn1_decode_ap_options() argument
542 { return asn1_decode_krb5_flags(buf,val); } in asn1_decode_ap_options()
544 asn1_error_code asn1_decode_kdc_options(asn1buf *buf, krb5_flags *val) in asn1_decode_kdc_options() argument
545 { return asn1_decode_krb5_flags(buf,val); } in asn1_decode_kdc_options()
547 asn1_error_code asn1_decode_transited_encoding(asn1buf *buf, krb5_transited *val) in asn1_decode_transited_encoding() argument
551 get_field(val->tr_type,0,asn1_decode_octet); in asn1_decode_transited_encoding()
552 get_lenfield(val->tr_contents.length,val->tr_contents.data,1,asn1_decode_charstring); in asn1_decode_transited_encoding()
554 val->magic = KV5M_TRANSITED; in asn1_decode_transited_encoding()
559 asn1_error_code asn1_decode_enc_kdc_rep_part(asn1buf *buf, krb5_enc_kdc_rep_part *val) in asn1_decode_enc_kdc_rep_part() argument
563 alloc_field(val->session,krb5_keyblock); in asn1_decode_enc_kdc_rep_part()
564 get_field(*(val->session),0,asn1_decode_encryption_key); in asn1_decode_enc_kdc_rep_part()
565 get_field(val->last_req,1,asn1_decode_last_req); in asn1_decode_enc_kdc_rep_part()
566 get_field(val->nonce,2,asn1_decode_int32); in asn1_decode_enc_kdc_rep_part()
567 opt_field(val->key_exp,3,asn1_decode_kerberos_time,0); in asn1_decode_enc_kdc_rep_part()
568 get_field(val->flags,4,asn1_decode_ticket_flags); in asn1_decode_enc_kdc_rep_part()
569 get_field(val->times.authtime,5,asn1_decode_kerberos_time); in asn1_decode_enc_kdc_rep_part()
571 opt_field(val->times.starttime,6,asn1_decode_kerberos_time,val->times.authtime); in asn1_decode_enc_kdc_rep_part()
572 get_field(val->times.endtime,7,asn1_decode_kerberos_time); in asn1_decode_enc_kdc_rep_part()
573 opt_field(val->times.renew_till,8,asn1_decode_kerberos_time,0); in asn1_decode_enc_kdc_rep_part()
574 alloc_field(val->server,krb5_principal_data); in asn1_decode_enc_kdc_rep_part()
575 get_field(val->server,9,asn1_decode_realm); in asn1_decode_enc_kdc_rep_part()
576 get_field(val->server,10,asn1_decode_principal_name); in asn1_decode_enc_kdc_rep_part()
577 opt_field(val->caddrs,11,asn1_decode_host_addresses,NULL); in asn1_decode_enc_kdc_rep_part()
579 val->magic = KV5M_ENC_KDC_REP_PART; in asn1_decode_enc_kdc_rep_part()
584 asn1_error_code asn1_decode_ticket(asn1buf *buf, krb5_ticket *val) in asn1_decode_ticket() argument
593 alloc_field(val->server,krb5_principal_data); in asn1_decode_ticket()
594 get_field(val->server,1,asn1_decode_realm); in asn1_decode_ticket()
595 get_field(val->server,2,asn1_decode_principal_name); in asn1_decode_ticket()
596 get_field(val->enc_part,3,asn1_decode_encrypted_data); in asn1_decode_ticket()
598 val->magic = KV5M_TICKET; in asn1_decode_ticket()
608 asn1_error_code asn1_decode_kdc_req(asn1buf *buf, krb5_kdc_req *val) in asn1_decode_kdc_req() argument
615 get_field(val->msg_type,2,asn1_decode_msgtype); in asn1_decode_kdc_req()
616 opt_field(val->padata,3,asn1_decode_sequence_of_pa_data,NULL); in asn1_decode_kdc_req()
617 get_field(*val,4,asn1_decode_kdc_req_body); in asn1_decode_kdc_req()
619 val->magic = KV5M_KDC_REQ; in asn1_decode_kdc_req()
624 asn1_error_code asn1_decode_kdc_req_body(asn1buf *buf, krb5_kdc_req *val) in asn1_decode_kdc_req_body() argument
630 get_field(val->kdc_options,0,asn1_decode_kdc_options); in asn1_decode_kdc_req_body()
631 if(tagnum == 1){ alloc_field(val->client,krb5_principal_data); } in asn1_decode_kdc_req_body()
632 opt_field(val->client,1,asn1_decode_principal_name,NULL); in asn1_decode_kdc_req_body()
633 alloc_field(val->server,krb5_principal_data); in asn1_decode_kdc_req_body()
634 get_field(val->server,2,asn1_decode_realm); in asn1_decode_kdc_req_body()
635 if(val->client != NULL){ in asn1_decode_kdc_req_body()
636 retval = asn1_krb5_realm_copy(val->client,val->server); in asn1_decode_kdc_req_body()
641 psave = val->server; in asn1_decode_kdc_req_body()
642 opt_field(val->server,3,asn1_decode_principal_name,NULL); in asn1_decode_kdc_req_body()
643 if(val->server == NULL){ in asn1_decode_kdc_req_body()
651 opt_field(val->from,4,asn1_decode_kerberos_time,0); in asn1_decode_kdc_req_body()
652 get_field(val->till,5,asn1_decode_kerberos_time); in asn1_decode_kdc_req_body()
653 opt_field(val->rtime,6,asn1_decode_kerberos_time,0); in asn1_decode_kdc_req_body()
654 get_field(val->nonce,7,asn1_decode_int32); in asn1_decode_kdc_req_body()
655 get_lenfield(val->nktypes,val->ktype,8,asn1_decode_sequence_of_enctype); in asn1_decode_kdc_req_body()
656 opt_field(val->addresses,9,asn1_decode_host_addresses,0); in asn1_decode_kdc_req_body()
658 get_field(val->authorization_data,10,asn1_decode_encrypted_data); } in asn1_decode_kdc_req_body()
660 val->authorization_data.magic = KV5M_ENC_DATA; in asn1_decode_kdc_req_body()
661 val->authorization_data.enctype = 0; in asn1_decode_kdc_req_body()
662 val->authorization_data.kvno = 0; in asn1_decode_kdc_req_body()
663 val->authorization_data.ciphertext.data = NULL; in asn1_decode_kdc_req_body()
664 val->authorization_data.ciphertext.length = 0; in asn1_decode_kdc_req_body()
666 opt_field(val->second_ticket,11,asn1_decode_sequence_of_ticket,NULL); in asn1_decode_kdc_req_body()
668 val->magic = KV5M_KDC_REQ; in asn1_decode_kdc_req_body()
673 asn1_error_code asn1_decode_krb_safe_body(asn1buf *buf, krb5_safe *val) in asn1_decode_krb_safe_body() argument
677 get_lenfield(val->user_data.length,val->user_data.data,0,asn1_decode_charstring); in asn1_decode_krb_safe_body()
678 opt_field(val->timestamp,1,asn1_decode_kerberos_time,0); in asn1_decode_krb_safe_body()
679 opt_field(val->usec,2,asn1_decode_int32,0); in asn1_decode_krb_safe_body()
680 opt_field(val->seq_number,3,asn1_decode_seqnum,0); in asn1_decode_krb_safe_body()
681 alloc_field(val->s_address,krb5_address); in asn1_decode_krb_safe_body()
682 get_field(*(val->s_address),4,asn1_decode_host_address); in asn1_decode_krb_safe_body()
684 alloc_field(val->r_address,krb5_address); in asn1_decode_krb_safe_body()
685 get_field(*(val->r_address),5,asn1_decode_host_address); in asn1_decode_krb_safe_body()
686 } else val->r_address = NULL; in asn1_decode_krb_safe_body()
688 val->magic = KV5M_SAFE; in asn1_decode_krb_safe_body()
693 asn1_error_code asn1_decode_host_address(asn1buf *buf, krb5_address *val) in asn1_decode_host_address() argument
697 get_field(val->addrtype,0,asn1_decode_addrtype); in asn1_decode_host_address()
698 get_lenfield(val->length,val->contents,1,asn1_decode_octetstring); in asn1_decode_host_address()
700 val->magic = KV5M_ADDRESS; in asn1_decode_host_address()
705 asn1_error_code asn1_decode_kdc_rep(asn1buf *buf, krb5_kdc_rep *val) in asn1_decode_kdc_rep() argument
712 get_field(val->msg_type,1,asn1_decode_msgtype); in asn1_decode_kdc_rep()
713 opt_field(val->padata,2,asn1_decode_sequence_of_pa_data,NULL); in asn1_decode_kdc_rep()
714 alloc_field(val->client,krb5_principal_data); in asn1_decode_kdc_rep()
715 get_field(val->client,3,asn1_decode_realm); in asn1_decode_kdc_rep()
716 get_field(val->client,4,asn1_decode_principal_name); in asn1_decode_kdc_rep()
717 alloc_field(val->ticket,krb5_ticket); in asn1_decode_kdc_rep()
718 get_field(*(val->ticket),5,asn1_decode_ticket); in asn1_decode_kdc_rep()
719 get_field(val->enc_part,6,asn1_decode_encrypted_data); in asn1_decode_kdc_rep()
721 val->magic = KV5M_KDC_REP; in asn1_decode_kdc_rep()
750 array_append(val,size,elt,type);\
752 if (*val == NULL)\
753 *val = (type **)malloc(sizeof(type*));\
754 (*val)[size] = NULL;\
760 asn1_error_code asn1_decode_authorization_data(asn1buf *buf, krb5_authdata ***val) in asn1_decode_authorization_data() argument
765 asn1_error_code asn1_decode_authdata_elt(asn1buf *buf, krb5_authdata *val) in asn1_decode_authdata_elt() argument
769 get_field(val->ad_type,0,asn1_decode_authdatatype); in asn1_decode_authdata_elt()
770 get_lenfield(val->length,val->contents,1,asn1_decode_octetstring); in asn1_decode_authdata_elt()
772 val->magic = KV5M_AUTHDATA; in asn1_decode_authdata_elt()
777 asn1_error_code asn1_decode_host_addresses(asn1buf *buf, krb5_address ***val) in asn1_decode_host_addresses() argument
782 asn1_error_code asn1_decode_sequence_of_ticket(asn1buf *buf, krb5_ticket ***val) in asn1_decode_sequence_of_ticket() argument
787 asn1_error_code asn1_decode_sequence_of_krb_cred_info(asn1buf *buf, krb5_cred_info ***val) in asn1_decode_sequence_of_krb_cred_info() argument
792 asn1_error_code asn1_decode_krb_cred_info(asn1buf *buf, krb5_cred_info *val) in asn1_decode_krb_cred_info() argument
796 alloc_field(val->session,krb5_keyblock); in asn1_decode_krb_cred_info()
797 get_field(*(val->session),0,asn1_decode_encryption_key); in asn1_decode_krb_cred_info()
799 alloc_field(val->client,krb5_principal_data); in asn1_decode_krb_cred_info()
800 opt_field(val->client,1,asn1_decode_realm,NULL); in asn1_decode_krb_cred_info()
801 opt_field(val->client,2,asn1_decode_principal_name,NULL); } in asn1_decode_krb_cred_info()
802 opt_field(val->flags,3,asn1_decode_ticket_flags,0); in asn1_decode_krb_cred_info()
803 opt_field(val->times.authtime,4,asn1_decode_kerberos_time,0); in asn1_decode_krb_cred_info()
804 opt_field(val->times.starttime,5,asn1_decode_kerberos_time,0); in asn1_decode_krb_cred_info()
805 opt_field(val->times.endtime,6,asn1_decode_kerberos_time,0); in asn1_decode_krb_cred_info()
806 opt_field(val->times.renew_till,7,asn1_decode_kerberos_time,0); in asn1_decode_krb_cred_info()
808 alloc_field(val->server,krb5_principal_data); in asn1_decode_krb_cred_info()
809 opt_field(val->server,8,asn1_decode_realm,NULL); in asn1_decode_krb_cred_info()
810 opt_field(val->server,9,asn1_decode_principal_name,NULL); } in asn1_decode_krb_cred_info()
811 opt_field(val->caddrs,10,asn1_decode_host_addresses,NULL); in asn1_decode_krb_cred_info()
813 val->magic = KV5M_CRED_INFO; in asn1_decode_krb_cred_info()
818 asn1_error_code asn1_decode_sequence_of_pa_data(asn1buf *buf, krb5_pa_data ***val) in asn1_decode_sequence_of_pa_data() argument
823 asn1_error_code asn1_decode_pa_data(asn1buf *buf, krb5_pa_data *val) in asn1_decode_pa_data() argument
827 get_field(val->pa_type,1,asn1_decode_int32); in asn1_decode_pa_data()
828 get_lenfield(val->length,val->contents,2,asn1_decode_octetstring); in asn1_decode_pa_data()
830 val->magic = KV5M_PA_DATA; in asn1_decode_pa_data()
835 asn1_error_code asn1_decode_last_req(asn1buf *buf, krb5_last_req_entry ***val) in asn1_decode_last_req() argument
840 asn1_error_code asn1_decode_last_req_entry(asn1buf *buf, krb5_last_req_entry *val) in asn1_decode_last_req_entry() argument
844 get_field(val->lr_type,0,asn1_decode_int32); in asn1_decode_last_req_entry()
845 get_field(val->value,1,asn1_decode_kerberos_time); in asn1_decode_last_req_entry()
847 val->magic = KV5M_LAST_REQ_ENTRY; in asn1_decode_last_req_entry()
851 if((val->lr_type & 0xffffff80U) == 0x80) val->lr_type |= 0xffffff00U; in asn1_decode_last_req_entry()
857 asn1_error_code asn1_decode_sequence_of_enctype(asn1buf *buf, int *num, krb5_enctype **val) in asn1_decode_sequence_of_enctype() argument
863 if (*val == NULL) in asn1_decode_sequence_of_enctype()
864 *val = (krb5_enctype*)malloc(size*sizeof(krb5_enctype)); in asn1_decode_sequence_of_enctype()
866 *val = (krb5_enctype*)realloc(*val,size*sizeof(krb5_enctype)); in asn1_decode_sequence_of_enctype()
867 if(*val == NULL) return ENOMEM; in asn1_decode_sequence_of_enctype()
868 retval = asn1_decode_enctype(&seqbuf,&((*val)[size-1])); in asn1_decode_sequence_of_enctype()
877 asn1_error_code asn1_decode_sequence_of_checksum(asn1buf *buf, krb5_checksum ***val) in asn1_decode_sequence_of_checksum() argument
882 static asn1_error_code asn1_decode_etype_info2_entry(asn1buf *buf, krb5_etype_info_entry *val ) in asn1_decode_etype_info2_entry() argument
894 get_field(val->etype,0,asn1_decode_enctype); in asn1_decode_etype_info2_entry()
896 get_lenfield(val->length,tmpp,1,asn1_decode_generalstring); in asn1_decode_etype_info2_entry()
897 val->salt = (krb5_octet*)tmpp; /* SUNW14resync hack */ in asn1_decode_etype_info2_entry()
899 val->length = KRB5_ETYPE_NO_SALT; in asn1_decode_etype_info2_entry()
900 val->salt = 0; in asn1_decode_etype_info2_entry()
904 get_lenfield( val->s2kparams.length, params, in asn1_decode_etype_info2_entry()
906 val->s2kparams.data = ( char *) params; in asn1_decode_etype_info2_entry()
908 val->s2kparams.data = NULL; in asn1_decode_etype_info2_entry()
909 val->s2kparams.length = 0; in asn1_decode_etype_info2_entry()
912 val->magic = KV5M_ETYPE_INFO_ENTRY; in asn1_decode_etype_info2_entry()
917 static asn1_error_code asn1_decode_etype_info2_entry_1_3(asn1buf *buf, krb5_etype_info_entry *val ) in asn1_decode_etype_info2_entry_1_3() argument
921 get_field(val->etype,0,asn1_decode_enctype); in asn1_decode_etype_info2_entry_1_3()
923 get_lenfield(val->length,val->salt,1,asn1_decode_octetstring); in asn1_decode_etype_info2_entry_1_3()
925 val->length = KRB5_ETYPE_NO_SALT; in asn1_decode_etype_info2_entry_1_3()
926 val->salt = 0; in asn1_decode_etype_info2_entry_1_3()
930 get_lenfield( val->s2kparams.length, params, in asn1_decode_etype_info2_entry_1_3()
932 val->s2kparams.data = ( char *) params; in asn1_decode_etype_info2_entry_1_3()
934 val->s2kparams.data = NULL; in asn1_decode_etype_info2_entry_1_3()
935 val->s2kparams.length = 0; in asn1_decode_etype_info2_entry_1_3()
938 val->magic = KV5M_ETYPE_INFO_ENTRY; in asn1_decode_etype_info2_entry_1_3()
944 static asn1_error_code asn1_decode_etype_info_entry(asn1buf *buf, krb5_etype_info_entry *val ) in asn1_decode_etype_info_entry() argument
948 get_field(val->etype,0,asn1_decode_enctype); in asn1_decode_etype_info_entry()
950 get_lenfield(val->length,val->salt,1,asn1_decode_octetstring); in asn1_decode_etype_info_entry()
952 val->length = KRB5_ETYPE_NO_SALT; in asn1_decode_etype_info_entry()
953 val->salt = 0; in asn1_decode_etype_info_entry()
955 val->s2kparams.data = NULL; in asn1_decode_etype_info_entry()
956 val->s2kparams.length = 0; in asn1_decode_etype_info_entry()
959 val->magic = KV5M_ETYPE_INFO_ENTRY; in asn1_decode_etype_info_entry()
964 asn1_error_code asn1_decode_etype_info(asn1buf *buf, krb5_etype_info_entry ***val ) in asn1_decode_etype_info() argument
969 asn1_error_code asn1_decode_etype_info2(asn1buf *buf, krb5_etype_info_entry ***val , in asn1_decode_etype_info2() argument
981 asn1_error_code asn1_decode_passwdsequence(asn1buf *buf, passwd_phrase_element *val) in asn1_decode_passwdsequence() argument
985 alloc_field(val->passwd,krb5_data); in asn1_decode_passwdsequence()
986 get_lenfield(val->passwd->length,val->passwd->data, in asn1_decode_passwdsequence()
988 val->passwd->magic = KV5M_DATA; in asn1_decode_passwdsequence()
989 alloc_field(val->phrase,krb5_data); in asn1_decode_passwdsequence()
990 get_lenfield(val->phrase->length,val->phrase->data, in asn1_decode_passwdsequence()
992 val->phrase->magic = KV5M_DATA; in asn1_decode_passwdsequence()
994 val->magic = KV5M_PASSWD_PHRASE_ELEMENT; in asn1_decode_passwdsequence()
999 asn1_error_code asn1_decode_sequence_of_passwdsequence(asn1buf *buf, passwd_phrase_element ***val) in asn1_decode_sequence_of_passwdsequence() argument
1004 asn1_error_code asn1_decode_sam_flags(asn1buf *buf, krb5_flags *val) in asn1_decode_sam_flags() argument
1005 { return asn1_decode_krb5_flags(buf,val); } in asn1_decode_sam_flags()
1007 #define opt_string(val,n,fn) opt_lenfield((val).length,(val).data,n,fn) argument
1013 asn1_error_code asn1_decode_sam_challenge(asn1buf *buf, krb5_sam_challenge *val) in asn1_decode_sam_challenge() argument
1017 get_field(val->sam_type,0,asn1_decode_int32); in asn1_decode_sam_challenge()
1018 get_field(val->sam_flags,1,asn1_decode_sam_flags); in asn1_decode_sam_challenge()
1019 opt_string(val->sam_type_name,2,asn1_decode_charstring); in asn1_decode_sam_challenge()
1020 opt_string(val->sam_track_id,3,asn1_decode_charstring); in asn1_decode_sam_challenge()
1021 opt_string(val->sam_challenge_label,4,asn1_decode_charstring); in asn1_decode_sam_challenge()
1022 opt_string(val->sam_challenge,5,asn1_decode_charstring); in asn1_decode_sam_challenge()
1023 opt_string(val->sam_response_prompt,6,asn1_decode_charstring); in asn1_decode_sam_challenge()
1024 opt_string(val->sam_pk_for_sad,7,asn1_decode_charstring); in asn1_decode_sam_challenge()
1025 opt_field(val->sam_nonce,8,asn1_decode_int32,0); in asn1_decode_sam_challenge()
1026 opt_cksum(val->sam_cksum,9,asn1_decode_checksum); in asn1_decode_sam_challenge()
1028 val->magic = KV5M_SAM_CHALLENGE; in asn1_decode_sam_challenge()
1032 asn1_error_code asn1_decode_sam_challenge_2(asn1buf *buf, krb5_sam_challenge_2 *val) in asn1_decode_sam_challenge_2() argument
1048 if ((val->sam_challenge_2_body.data = (char *) malloc(alloclen)) == NULL) in asn1_decode_sam_challenge_2()
1050 val->sam_challenge_2_body.length = alloclen; in asn1_decode_sam_challenge_2()
1051 memcpy(val->sam_challenge_2_body.data, save, alloclen); in asn1_decode_sam_challenge_2()
1053 get_field(val->sam_cksum, 1, asn1_decode_sequence_of_checksum); in asn1_decode_sam_challenge_2()
1058 asn1_error_code asn1_decode_sam_challenge_2_body(asn1buf *buf, krb5_sam_challenge_2_body *val) in asn1_decode_sam_challenge_2_body() argument
1062 get_field(val->sam_type,0,asn1_decode_int32); in asn1_decode_sam_challenge_2_body()
1063 get_field(val->sam_flags,1,asn1_decode_sam_flags); in asn1_decode_sam_challenge_2_body()
1064 opt_string(val->sam_type_name,2,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1065 opt_string(val->sam_track_id,3,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1066 opt_string(val->sam_challenge_label,4,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1067 opt_string(val->sam_challenge,5,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1068 opt_string(val->sam_response_prompt,6,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1069 opt_string(val->sam_pk_for_sad,7,asn1_decode_charstring); in asn1_decode_sam_challenge_2_body()
1070 get_field(val->sam_nonce,8,asn1_decode_int32); in asn1_decode_sam_challenge_2_body()
1071 get_field(val->sam_etype, 9, asn1_decode_int32); in asn1_decode_sam_challenge_2_body()
1073 val->magic = KV5M_SAM_CHALLENGE; in asn1_decode_sam_challenge_2_body()
1077 asn1_error_code asn1_decode_enc_sam_key(asn1buf *buf, krb5_sam_key *val) in asn1_decode_enc_sam_key() argument
1082 get_field(val->sam_key,0,asn1_decode_encryption_key); in asn1_decode_enc_sam_key()
1084 val->magic = KV5M_SAM_KEY; in asn1_decode_enc_sam_key()
1089 asn1_error_code asn1_decode_enc_sam_response_enc(asn1buf *buf, krb5_enc_sam_response_enc *val) in asn1_decode_enc_sam_response_enc() argument
1093 opt_field(val->sam_nonce,0,asn1_decode_int32,0); in asn1_decode_enc_sam_response_enc()
1094 opt_field(val->sam_timestamp,1,asn1_decode_kerberos_time,0); in asn1_decode_enc_sam_response_enc()
1095 opt_field(val->sam_usec,2,asn1_decode_int32,0); in asn1_decode_enc_sam_response_enc()
1096 opt_string(val->sam_sad,3,asn1_decode_charstring); in asn1_decode_enc_sam_response_enc()
1098 val->magic = KV5M_ENC_SAM_RESPONSE_ENC; in asn1_decode_enc_sam_response_enc()
1103 asn1_error_code asn1_decode_enc_sam_response_enc_2(asn1buf *buf, krb5_enc_sam_response_enc_2 *val) in asn1_decode_enc_sam_response_enc_2() argument
1107 get_field(val->sam_nonce,0,asn1_decode_int32); in asn1_decode_enc_sam_response_enc_2()
1108 opt_string(val->sam_sad,1,asn1_decode_charstring); in asn1_decode_enc_sam_response_enc_2()
1110 val->magic = KV5M_ENC_SAM_RESPONSE_ENC_2; in asn1_decode_enc_sam_response_enc_2()
1126 asn1_error_code asn1_decode_sam_response(asn1buf *buf, krb5_sam_response *val) in asn1_decode_sam_response() argument
1130 get_field(val->sam_type,0,asn1_decode_int32); in asn1_decode_sam_response()
1131 get_field(val->sam_flags,1,asn1_decode_sam_flags); in asn1_decode_sam_response()
1132 opt_string(val->sam_track_id,2,asn1_decode_charstring); in asn1_decode_sam_response()
1133 opt_encfield(val->sam_enc_key,3,asn1_decode_encrypted_data); in asn1_decode_sam_response()
1134 get_field(val->sam_enc_nonce_or_ts,4,asn1_decode_encrypted_data); in asn1_decode_sam_response()
1135 opt_field(val->sam_nonce,5,asn1_decode_int32,0); in asn1_decode_sam_response()
1136 opt_field(val->sam_patimestamp,6,asn1_decode_kerberos_time,0); in asn1_decode_sam_response()
1138 val->magic = KV5M_SAM_RESPONSE; in asn1_decode_sam_response()
1143 asn1_error_code asn1_decode_sam_response_2(asn1buf *buf, krb5_sam_response_2 *val) in asn1_decode_sam_response_2() argument
1147 get_field(val->sam_type,0,asn1_decode_int32); in asn1_decode_sam_response_2()
1148 get_field(val->sam_flags,1,asn1_decode_sam_flags); in asn1_decode_sam_response_2()
1149 opt_string(val->sam_track_id,2,asn1_decode_charstring); in asn1_decode_sam_response_2()
1150 get_field(val->sam_enc_nonce_or_sad,3,asn1_decode_encrypted_data); in asn1_decode_sam_response_2()
1151 get_field(val->sam_nonce,4,asn1_decode_int32); in asn1_decode_sam_response_2()
1153 val->magic = KV5M_SAM_RESPONSE; in asn1_decode_sam_response_2()
1159 asn1_error_code asn1_decode_predicted_sam_response(asn1buf *buf, krb5_predicted_sam_response *val) in asn1_decode_predicted_sam_response() argument
1163 get_field(val->sam_key,0,asn1_decode_encryption_key); in asn1_decode_predicted_sam_response()
1164 get_field(val->sam_flags,1,asn1_decode_sam_flags); in asn1_decode_predicted_sam_response()
1165 get_field(val->stime,2,asn1_decode_kerberos_time); in asn1_decode_predicted_sam_response()
1166 get_field(val->susec,3,asn1_decode_int32); in asn1_decode_predicted_sam_response()
1167 alloc_field(val->client,krb5_principal_data); in asn1_decode_predicted_sam_response()
1168 get_field(val->client,4,asn1_decode_realm); in asn1_decode_predicted_sam_response()
1169 get_field(val->client,5,asn1_decode_principal_name); in asn1_decode_predicted_sam_response()
1170 opt_string(val->msd,6,asn1_decode_charstring); /* should be octet */ in asn1_decode_predicted_sam_response()
1172 val->magic = KV5M_PREDICTED_SAM_RESPONSE; in asn1_decode_predicted_sam_response()
1179 …de asn1_decode_external_principal_identifier(asn1buf *buf, krb5_external_principal_identifier *val) in asn1_decode_external_principal_identifier() argument
1184 opt_implicit_octet_string(val->subjectName.length, val->subjectName.data, 0); in asn1_decode_external_principal_identifier()
1185 … opt_implicit_octet_string(val->issuerAndSerialNumber.length, val->issuerAndSerialNumber.data, 1); in asn1_decode_external_principal_identifier()
1186 … opt_implicit_octet_string(val->subjectKeyIdentifier.length, val->subjectKeyIdentifier.data, 2); in asn1_decode_external_principal_identifier()
1192 …_sequence_of_external_principal_identifier(asn1buf *buf, krb5_external_principal_identifier ***val) in asn1_decode_sequence_of_external_principal_identifier() argument
1197 asn1_error_code asn1_decode_pa_pk_as_req(asn1buf *buf, krb5_pa_pk_as_req *val) in asn1_decode_pa_pk_as_req() argument
1202 get_implicit_octet_string(val->signedAuthPack.length, val->signedAuthPack.data, 0); in asn1_decode_pa_pk_as_req()
1203 … opt_field(val->trustedCertifiers, 1, asn1_decode_sequence_of_external_principal_identifier, NULL); in asn1_decode_pa_pk_as_req()
1204 opt_implicit_octet_string(val->kdcPkId.length, val->kdcPkId.data, 2); in asn1_decode_pa_pk_as_req()
1211 asn1_error_code asn1_decode_trusted_ca(asn1buf *buf, krb5_trusted_ca *val)
1220 val->choice = choice_trusted_cas_principalName;
1222 val->choice = choice_trusted_cas_caName;
1231 val->u.caName.data = malloc(alloclen);
1232 if (val->u.caName.data == NULL)
1234 memcpy(val->u.caName.data, start, alloclen);
1235 val->u.caName.length = alloclen;
1238 val->choice = choice_trusted_cas_issuerAndSerial;
1247 val->u.issuerAndSerial.data = malloc(alloclen);
1248 if (val->u.issuerAndSerial.data == NULL)
1250 memcpy(val->u.issuerAndSerial.data, start, alloclen);
1251 val->u.issuerAndSerial.length = alloclen;
1259 asn1_error_code asn1_decode_trusted_ca(asn1buf *buf, krb5_trusted_ca *val) in asn1_decode_trusted_ca() argument
1264 val->choice = choice_trusted_cas_principalName; in asn1_decode_trusted_ca()
1265 asn1_decode_krb5_principal_name(&subbuf, &(val->u.principalName)); in asn1_decode_trusted_ca()
1267 val->choice = choice_trusted_cas_caName; in asn1_decode_trusted_ca()
1268 get_implicit_octet_string(val->u.caName.length, val->u.caName.data, choice_trusted_cas_caName); in asn1_decode_trusted_ca()
1270 val->choice = choice_trusted_cas_issuerAndSerial; in asn1_decode_trusted_ca()
1271 get_implicit_octet_string(val->u.issuerAndSerial.length, val->u.issuerAndSerial.data, in asn1_decode_trusted_ca()
1280 asn1_error_code asn1_decode_sequence_of_trusted_ca(asn1buf *buf, krb5_trusted_ca ***val) in asn1_decode_sequence_of_trusted_ca() argument
1285 asn1_error_code asn1_decode_pa_pk_as_req_draft9(asn1buf *buf, krb5_pa_pk_as_req_draft9 *val) in asn1_decode_pa_pk_as_req_draft9() argument
1289 get_implicit_octet_string(val->signedAuthPack.length, val->signedAuthPack.data, 0); in asn1_decode_pa_pk_as_req_draft9()
1290 opt_field(val->trustedCertifiers, 1, asn1_decode_sequence_of_trusted_ca, NULL); in asn1_decode_pa_pk_as_req_draft9()
1291 opt_lenfield(val->kdcCert.length, val->kdcCert.data, 2, asn1_decode_octetstring); in asn1_decode_pa_pk_as_req_draft9()
1292 opt_lenfield(val->encryptionCert.length, val->encryptionCert.data, 2, asn1_decode_octetstring); in asn1_decode_pa_pk_as_req_draft9()
1298 asn1_error_code asn1_decode_dh_rep_info(asn1buf *buf, krb5_dh_rep_info *val) in asn1_decode_dh_rep_info() argument
1302 get_implicit_octet_string(val->dhSignedData.length, val->dhSignedData.data, 0); in asn1_decode_dh_rep_info()
1304 opt_lenfield(val->serverDHNonce.length, val->serverDHNonce.data, 1, asn1_decode_octetstring); in asn1_decode_dh_rep_info()
1310 asn1_error_code asn1_decode_pk_authenticator(asn1buf *buf, krb5_pk_authenticator *val) in asn1_decode_pk_authenticator() argument
1314 get_field(val->cusec, 0, asn1_decode_int32); in asn1_decode_pk_authenticator()
1315 get_field(val->ctime, 1, asn1_decode_kerberos_time); in asn1_decode_pk_authenticator()
1316 get_field(val->nonce, 2, asn1_decode_int32); in asn1_decode_pk_authenticator()
1317 opt_lenfield(val->paChecksum.length, val->paChecksum.contents, 3, asn1_decode_octetstring); in asn1_decode_pk_authenticator()
1323 asn1_error_code asn1_decode_pk_authenticator_draft9(asn1buf *buf, krb5_pk_authenticator_draft9 *val) in asn1_decode_pk_authenticator_draft9() argument
1327 alloc_field(val->kdcName,krb5_principal_data); in asn1_decode_pk_authenticator_draft9()
1328 get_field(val->kdcName, 0, asn1_decode_principal_name); in asn1_decode_pk_authenticator_draft9()
1329 get_field(val->kdcName, 1, asn1_decode_realm); in asn1_decode_pk_authenticator_draft9()
1330 get_field(val->cusec, 2, asn1_decode_int32); in asn1_decode_pk_authenticator_draft9()
1331 get_field(val->ctime, 3, asn1_decode_kerberos_time); in asn1_decode_pk_authenticator_draft9()
1332 get_field(val->nonce, 4, asn1_decode_int32); in asn1_decode_pk_authenticator_draft9()
1338 asn1_error_code asn1_decode_algorithm_identifier(asn1buf *buf, krb5_algorithm_identifier *val) { in asn1_decode_algorithm_identifier() argument
1358 retval = asn1_decode_oid(&subbuf, &val->algorithm.length, in asn1_decode_algorithm_identifier()
1359 &val->algorithm.data); in asn1_decode_algorithm_identifier()
1361 val->parameters.length = 0; in asn1_decode_algorithm_identifier()
1362 val->parameters.data = NULL; in asn1_decode_algorithm_identifier()
1367 &val->parameters.data); in asn1_decode_algorithm_identifier()
1369 val->parameters.length = size; in asn1_decode_algorithm_identifier()
1377 asn1_error_code asn1_decode_subject_pk_info(asn1buf *buf, krb5_subject_pk_info *val) in asn1_decode_subject_pk_info() argument
1383 retval = asn1_decode_algorithm_identifier(&subbuf, &val->algorithm); in asn1_decode_subject_pk_info()
1400 val->subjectPublicKey.length = 0; in asn1_decode_subject_pk_info()
1401 val->subjectPublicKey.data = NULL; in asn1_decode_subject_pk_info()
1403 &val->subjectPublicKey.data); in asn1_decode_subject_pk_info()
1405 val->subjectPublicKey.length = taglen; in asn1_decode_subject_pk_info()
1416 …r_code asn1_decode_sequence_of_algorithm_identifier(asn1buf *buf, krb5_algorithm_identifier ***val) in asn1_decode_sequence_of_algorithm_identifier() argument
1421 asn1_error_code asn1_decode_kdc_dh_key_info (asn1buf *buf, krb5_kdc_dh_key_info *val) in asn1_decode_kdc_dh_key_info() argument
1425 retval = asn1buf_remove_octetstring(&subbuf, taglen, &val->subjectPublicKey.data); in asn1_decode_kdc_dh_key_info()
1427 val->subjectPublicKey.length = taglen; in asn1_decode_kdc_dh_key_info()
1429 get_field(val->nonce, 1, asn1_decode_int32); in asn1_decode_kdc_dh_key_info()
1430 opt_field(val->dhKeyExpiration, 2, asn1_decode_kerberos_time, 0); in asn1_decode_kdc_dh_key_info()
1436 asn1_error_code asn1_decode_reply_key_pack (asn1buf *buf, krb5_reply_key_pack *val) in asn1_decode_reply_key_pack() argument
1440 get_field(val->replyKey, 0, asn1_decode_encryption_key); in asn1_decode_reply_key_pack()
1441 get_field(val->asChecksum, 1, asn1_decode_checksum); in asn1_decode_reply_key_pack()
1447 asn1_error_code asn1_decode_reply_key_pack_draft9 (asn1buf *buf, krb5_reply_key_pack_draft9 *val) in asn1_decode_reply_key_pack_draft9() argument
1451 get_field(val->replyKey, 0, asn1_decode_encryption_key); in asn1_decode_reply_key_pack_draft9()
1452 get_field(val->nonce, 1, asn1_decode_int32); in asn1_decode_reply_key_pack_draft9()
1459 asn1_error_code asn1_decode_krb5_principal_name (asn1buf *buf, krb5_principal *val) in asn1_decode_krb5_principal_name() argument
1463 get_field(*val, 0, asn1_decode_realm); in asn1_decode_krb5_principal_name()
1464 get_field(*val, 1, asn1_decode_principal_name); in asn1_decode_krb5_principal_name()
1470 asn1_error_code asn1_decode_auth_pack(asn1buf *buf, krb5_auth_pack *val) in asn1_decode_auth_pack() argument
1474 get_field(val->pkAuthenticator, 0, asn1_decode_pk_authenticator); in asn1_decode_auth_pack()
1475 if (tagnum == 1) { alloc_field(val->clientPublicValue, krb5_subject_pk_info); } in asn1_decode_auth_pack()
1483 val->clientPublicValue); in asn1_decode_auth_pack()
1486 } else val->clientPublicValue = NULL; in asn1_decode_auth_pack()
1491 asn1_decode_sequence_of_algorithm_identifier(&subbuf, &val->supportedCMSTypes); in asn1_decode_auth_pack()
1494 } else val->supportedCMSTypes = NULL; in asn1_decode_auth_pack()
1496 opt_lenfield(val->clientDHNonce.length, val->clientDHNonce.data, 3, asn1_decode_octetstring); in asn1_decode_auth_pack()
1502 asn1_error_code asn1_decode_auth_pack_draft9(asn1buf *buf, krb5_auth_pack_draft9 *val) in asn1_decode_auth_pack_draft9() argument
1506 get_field(val->pkAuthenticator, 0, asn1_decode_pk_authenticator_draft9); in asn1_decode_auth_pack_draft9()
1508 alloc_field(val->clientPublicValue, krb5_subject_pk_info); in asn1_decode_auth_pack_draft9()
1516 val->clientPublicValue); in asn1_decode_auth_pack_draft9()
1519 } else val->clientPublicValue = NULL; in asn1_decode_auth_pack_draft9()
1527 asn1_error_code asn1_decode_pa_pk_as_rep(asn1buf *buf, krb5_pa_pk_as_rep *val) in asn1_decode_pa_pk_as_rep() argument
1532 val->choice = choice_pa_pk_as_rep_dhInfo; in asn1_decode_pa_pk_as_rep()
1533 get_field_body(val->u.dh_Info, asn1_decode_dh_rep_info); in asn1_decode_pa_pk_as_rep()
1535 val->choice = choice_pa_pk_as_rep_encKeyPack; in asn1_decode_pa_pk_as_rep()
1536 get_implicit_octet_string(val->u.encKeyPack.length, val->u.encKeyPack.data, in asn1_decode_pa_pk_as_rep()
1539 val->choice = choice_pa_pk_as_rep_UNKNOWN; in asn1_decode_pa_pk_as_rep()
1546 asn1_error_code asn1_decode_pa_pk_as_rep_draft9(asn1buf *buf, krb5_pa_pk_as_rep_draft9 *val) in asn1_decode_pa_pk_as_rep_draft9() argument
1551 val->choice = choice_pa_pk_as_rep_draft9_dhSignedData; in asn1_decode_pa_pk_as_rep_draft9()
1552 get_lenfield(val->u.dhSignedData.length, val->u.dhSignedData.data, in asn1_decode_pa_pk_as_rep_draft9()
1555 val->choice = choice_pa_pk_as_rep_draft9_encKeyPack; in asn1_decode_pa_pk_as_rep_draft9()
1556 get_lenfield(val->u.encKeyPack.length, val->u.encKeyPack.data, in asn1_decode_pa_pk_as_rep_draft9()
1559 val->choice = choice_pa_pk_as_rep_draft9_UNKNOWN; in asn1_decode_pa_pk_as_rep_draft9()
1566 asn1_error_code asn1_decode_sequence_of_typed_data(asn1buf *buf, krb5_typed_data ***val) in asn1_decode_sequence_of_typed_data() argument
1571 asn1_error_code asn1_decode_typed_data(asn1buf *buf, krb5_typed_data *val) in asn1_decode_typed_data() argument
1575 get_field(val->type,0,asn1_decode_int32); in asn1_decode_typed_data()
1576 get_lenfield(val->length,val->data,1,asn1_decode_octetstring); in asn1_decode_typed_data()