/* First field is the same as etype-info. */
DEFCNFIELD(etype_info2_1_def, krb5_etype_info_entry, salt, length, 1,
u_generalstring);
-DEFOPTIONALTYPE(etype_info2_1, is_salt_present, NULL, etype_info2_1_def);
+DEFOPTIONALTYPE(etype_info2_1, is_salt_present, init_no_salt,
+ etype_info2_1_def);
DEFFIELD(etype_info2_2, krb5_etype_info_entry, s2kparams, 2, opt_ostring_data);
static const struct atype_info *etype_info2_entry_fields[] = {
&k5_atype_etype_info_0, &k5_atype_etype_info2_1, &k5_atype_etype_info2_2
ktest_destroy_etype_info(ref);
}
+ /****************************************************************/
+ /* decode_etype_info2 */
+ {
+ krb5_etype_info ref, var;
+
+ ktest_make_sample_etype_info2(&ref);
+ retval = krb5_data_hex_parse(&code,"30 51 30 1E A0 03 02 01 00 A1 0D 1B 0B 4D 6F 72 74 6F 6E 27 73 20 23 30 A2 08 04 06 73 32 6B 3A 20 30 30 0F A0 03 02 01 01 A2 08 04 06 73 32 6B 3A 20 31 30 1E A0 03 02 01 02 A1 0D 1B 0B 4D 6F 72 74 6F 6E 27 73 20 23 32 A2 08 04 06 73 32 6B 3A 20 32");
+ if (retval) {
+ com_err("krb5_decode_test", retval, "while parsing etype_info2");
+ exit(1);
+ }
+ retval = decode_krb5_etype_info2(&code,&var);
+ if (retval) {
+ com_err("krb5_decode_test", retval, "while decoding etype_info2");
+ }
+ test(ktest_equal_etype_info(ref,var),"etype_info2\n");
+
+ ktest_destroy_etype_info(var);
+ ktest_destroy_etype_info_entry(ref[2]); ref[2] = 0;
+ ktest_destroy_etype_info_entry(ref[1]); ref[1] = 0;
+ krb5_free_data_contents(test_context, &code);
+
+ retval = krb5_data_hex_parse(&code,"30 20 30 1E A0 03 02 01 00 A1 0D 1B 0B 4D 6F 72 74 6F 6E 27 73 20 23 30 A2 08 04 06 73 32 6B 3A 20 30");
+ if (retval) {
+ com_err("krb5_decode_test", retval,
+ "while parsing etype_info2 (only one)");
+ exit(1);
+ }
+ retval = decode_krb5_etype_info2(&code,&var);
+ if (retval) {
+ com_err("krb5_decode_test", retval,
+ "while decoding etype_info2 (only one)");
+ }
+ test(ktest_equal_etype_info(ref,var),"etype_info2 (only one)\n");
+
+ krb5_free_data_contents(test_context, &code);
+ ktest_destroy_etype_info(var);
+ ktest_destroy_etype_info(ref);
+ }
+
/****************************************************************/
/* decode_pa_enc_ts */
{