--- /dev/null
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+#include <krb5/kdb.h>
+#include <stdio.h>
+#include "kdc_util.h"
+
+void
+main(argc,argv)
+ int argc;
+ char *argv[];
+ {
+ krb5_data otrans;
+ krb5_data ntrans;
+
+ krb5_data *tgnames[10];
+ krb5_principal tgs = tgnames;
+ krb5_data tgsrlm;
+
+ krb5_data *cnames[10];
+ krb5_principal cl = cnames;
+ krb5_data crlm;
+
+ krb5_data *snames[10];
+ krb5_principal sv = snames;
+ krb5_data srlm;
+
+ if (argc < 4) {
+ fprintf(stderr, "not enough args\n");
+ exit(1);
+ }
+ ntrans.length = 0;
+ otrans.length = strlen(argv[1]) + 1;
+ otrans.data = (char *) malloc(otrans.length);
+ strcpy(otrans.data,argv[1]);
+
+ tgsrlm.length = strlen(argv[2]) + 1;
+ tgsrlm.data = (char *) malloc(tgsrlm.length);
+ strcpy(tgsrlm.data,argv[2]);
+ tgs[0] = &tgsrlm;
+
+ crlm.length = strlen(argv[3]) + 1;
+ crlm.data = (char *) malloc(crlm.length);
+ strcpy(crlm.data,argv[3]);
+ cl[0] = &crlm;
+
+ srlm.length = strlen(argv[4]) + 1;
+ srlm.data = (char *) malloc(srlm.length);
+ strcpy(srlm.data,argv[4]);
+ sv[0] = &srlm;
+
+ add_to_transited(&otrans,&ntrans,tgs,cl,sv);
+
+ printf("%s\n",ntrans.data);
+
+ }
+
+krb5_encrypt_block master_encblock;
--- /dev/null
+ATHENA.MIT.EDU
+MIT.EDU,ATHENA.
+EDU,MIT.,ATHENA.
+EDU,MIT.,ATHENA.,WASHINGTON.EDU
+EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.
+EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.,SUB3W.CS.WASHINGTON.EDU
+EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+EDU,ATHENA.MIT.,SUB2M.,WASHINGTON.EDU,CS.
+/EDU/MIT/ATHENA
+/EDU/MIT,/ATHENA
+/EDU/MIT,/ATHENA
+/EDU,/MIT,/ATHENA
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON,/CS
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON,/CS,/SUB2W
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON,/CS,/SUB2W, /EDU/WASHINGTON/CS/SUB3W
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON,/CS,/SUB2W
+/EDU,/MIT,/ATHENA, /EDU/WASHINGTON,/CS,/SUB2W
+/EDU,/MIT/ATHENA,/SUB2M, /EDU/WASHINGTON,/CS
+EDU,MIT.,ATHENA.,ATEST., /COM,/HP,/APOLLO
+EDU,MIT.,ATHENA., /COM,/HP,/APOLLO,/HTEST
+/COM,/HP,/APOLLO,EDU,MIT.,ATHENA.,ATEST.
+/COM,/HP,/APOLLO,ATHENA.MIT.EDU
+EDU,MIT.,ATHENA., /COM/HP/APOLLO/HTEST
--- /dev/null
+#!/bin/sh
+# should print:
+#ATHENA.MIT.EDU
+#MIT.EDU,ATHENA.
+#EDU,MIT.,ATHENA.
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.,SUB3W.CS.WASHINGTON.EDU
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+#EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W.
+#EDU,ATHENA.MIT.,SUB2M.,WASHINGTON.EDU,CS.
+#
+./rtest "" ATHENA.MIT.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest ATHENA.MIT.EDU MIT.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "MIT.EDU,ATHENA." EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA." WASHINGTON.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA.,WASHINGTON.EDU" CS.WASHINGTON.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS." SUB2W.CS.WASHINGTON.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W." SUB3W.CS.WASHINGTON.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W." SUB1W.CS.WASHINGTON.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,MIT.,ATHENA.,WASHINGTON.EDU,CS.,SUB2W." SUB1M.ATHENA.MIT.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU
+./rtest "EDU,SUB2M.ATHENA.MIT.,WASHINGTON.EDU,CS." ATHENA.MIT.EDU SUB1W.CS.WASHINGTON.EDU SUB1M.ATHENA.MIT.EDU