diff options
author | John Kohl <jtkohl@mit.edu> | 1991-04-30 15:50:26 +0000 |
---|---|---|
committer | John Kohl <jtkohl@mit.edu> | 1991-04-30 15:50:26 +0000 |
commit | 68fcba12f0a0027c0aca2e358a183f58cfe9164d (patch) | |
tree | 1c4f6bb83deaf9a871077300ba3617dd8d193db2 /src/appl/simple/client/sim_client.c | |
parent | 7f994f5b196a80ae18905051f39c3491424e1ee5 (diff) | |
download | krb5-68fcba12f0a0027c0aca2e358a183f58cfe9164d.zip krb5-68fcba12f0a0027c0aca2e358a183f58cfe9164d.tar.gz krb5-68fcba12f0a0027c0aca2e358a183f58cfe9164d.tar.bz2 |
convert to krb5_build_principal
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2073 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/simple/client/sim_client.c')
-rw-r--r-- | src/appl/simple/client/sim_client.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/appl/simple/client/sim_client.c b/src/appl/simple/client/sim_client.c index d3b1eb8..68c73d3 100644 --- a/src/appl/simple/client/sim_client.c +++ b/src/appl/simple/client/sim_client.c @@ -60,8 +60,7 @@ char *argv[]; krb5_error_code retval; char *c_realm; /* local Kerberos realm */ char **s_realms; /* server's Kerberos realm(s) */ - krb5_data scontents[3], *server[4]; /* a krb5_principal is really a - krb5_data *[] */ + krb5_principal server; krb5_data packet, inbuf; krb5_checksum send_cksum; krb5_ccache ccdef; @@ -178,16 +177,12 @@ char *argv[]; [2] == FULL host name (by convention) [3] == null ptr */ - scontents[0].length = strlen(s_realms[0]); - scontents[0].data = s_realms[0]; - scontents[1].length = strlen(SERVICE); - scontents[1].data = SERVICE; - scontents[2].length = strlen(full_hname); - scontents[2].data = full_hname; - server[0] = &scontents[0]; - server[1] = &scontents[1]; - server[2] = &scontents[2]; - server[3] = 0; + if (retval = krb5_build_principal(&server, + strlen(s_realms[0]), s_realms[0], + SERVICE, full_hname, 0)) { + com_err(PROGNAME, retval, "while setting up server principal"); + exit(1); + } if (retval = krb5_mk_req(server, 0, /* use default options */ @@ -275,6 +270,8 @@ char *argv[]; exit(1); } + krb5_free_principal(server); + /* Make the safe message */ inbuf.data = argc == 3 ? argv[2] : MSG; inbuf.length = strlen (inbuf.data); |