From: Richard Basch Date: Thu, 11 Apr 1996 00:39:27 +0000 (+0000) Subject: V4 srvtab extraction did not do proper principal translation X-Git-Tag: krb5-1.0-beta6~227 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=396b16dddf3e64a992d55ca38e47fa8d5880bf74;p=krb5.git V4 srvtab extraction did not do proper principal translation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7788 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/admin/edit/ChangeLog b/src/admin/edit/ChangeLog index 584601cf1..cf400c161 100644 --- a/src/admin/edit/ChangeLog +++ b/src/admin/edit/ChangeLog @@ -1,3 +1,8 @@ +Wed Apr 10 19:17:58 1996 Richard Basch + + * kdb5_edit.c (extract_v4_srvtab): Translate the principal name to + the common V4 name. + Tue Mar 19 18:00:58 1996 Richard Basch * kdb5_edit.c (extract_v4_srvtab): do not test to make sure we diff --git a/src/admin/edit/kdb5_edit.c b/src/admin/edit/kdb5_edit.c index 4c0a380b6..7aa0f63ad 100644 --- a/src/admin/edit/kdb5_edit.c +++ b/src/admin/edit/kdb5_edit.c @@ -783,6 +783,9 @@ void extract_v4_srvtab(argc, argv) int nentries; krb5_boolean more; krb5_keyblock key; + char v4_name[65]; + char v4_inst[65]; + char v4_realm[65]; if (argc < 3) { com_err(argv[0], 0, "Too few arguments"); @@ -861,23 +864,32 @@ void extract_v4_srvtab(argc, argv) exit_status++; goto cleanmost; } - if (krb5_dbe_find_enctype(edit_context, - &dbentry, - ENCTYPE_DES_CBC_CRC, - KRB5_KDB_SALTTYPE_V4, - -1, - &pkey) && - (retval = krb5_dbe_find_enctype(edit_context, - &dbentry, - ENCTYPE_DES_CBC_CRC, - -1, - -1, - &pkey))) { - com_err(argv[0], retval, "while retrieving %s", pname); + + retval = krb5_524_conv_principal(edit_context, princ, + v4_name, v4_inst, v4_realm); + if (retval) { + com_err(argv[0], retval, "while translating principal"); exit_status++; goto cleanmost; } + if (krb5_dbe_find_enctype(edit_context, + &dbentry, + ENCTYPE_DES_CBC_CRC, + KRB5_KDB_SALTTYPE_V4, + -1, + &pkey) && + (retval = krb5_dbe_find_enctype(edit_context, + &dbentry, + ENCTYPE_DES_CBC_CRC, + -1, + -1, + &pkey))) + { + com_err(argv[0], retval, "while retrieving %s", pname); + exit_status++; + goto cleanmost; + } if ((retval = krb5_dbekd_decrypt_key_data(edit_context, &master_encblock, @@ -887,9 +899,11 @@ void extract_v4_srvtab(argc, argv) exit_status++; goto cleanall; } - fwrite(argv[i], strlen(argv[i]) + 1, 1, fout); /* p.name */ - fwrite(argv[1], strlen(argv[1]) + 1, 1, fout); /* p.instance */ - fwrite(cur_realm, strlen(cur_realm) + 1, 1, fout); /* p.realm */ + + fwrite(v4_name, strlen(v4_name) + 1, 1, fout); /* p.name */ + fwrite(v4_inst, strlen(v4_inst) + 1, 1, fout); /* p.instance */ + fwrite(v4_realm, strlen(v4_realm) + 1, 1, fout); /* p.realm */ + kvno = (unsigned char) dbentry.key_data[0].key_data_kvno; fwrite((char *)&kvno, sizeof(kvno), 1, fout); fwrite((char *)key.contents, 8, 1, fout);