+Thu Apr 20 20:12:32 1995 Mark Eichin <eichin@cygnus.com>
+
+ Changes for testsuite from Ian Taylor <ian@cygnus.com>
+ * kerberos5.c (telnet_srvtab): New global variable.
+ (telnet_krb5_realm): New global variable.
+ (kerberos5_send): If telnet_krb5_realm is set, copy it into
+ creds.server. Pass new_creds to krb5_mk_req_extended, not &creds.
+ Pass &new_creds->keyblock to krb5_copy_keyblock_contents, not
+ new_creds.
+ (kerberos5_is): pass telnet_srvtab in to krb_rd_req.
+ (kerberos5_forward): If telnet_krb5_realm is set, copy it into
+ local_creds->server.
+
Wed Mar 29 15:08:43 1995 Theodore Y. Ts'o (tytso@dcl)
* kerberos5.c: No need to have the session_key established for
#define Voidptr krb5_pointer
krb5_keyblock session_key;
+char * telnet_srvtab = NULL;
+char * telnet_krb5_realm = NULL;
static int
Data(ap, type, d, c)
return(0);
}
+ if (telnet_krb5_realm != NULL) {
+ krb5_data rdata;
+
+ rdata.length = strlen(telnet_krb5_realm);
+ rdata.data = (char *) malloc(rdata.length + 1);
+ if (rdata.data == NULL) {
+ fprintf(stderr, "malloc failed\n");
+ return(0);
+ }
+ strcpy(rdata.data, telnet_krb5_realm);
+ krb5_princ_set_realm(telnet_context, creds.server, &rdata);
+ }
+
if (r = krb5_cc_get_principal(telnet_context, ccache, &creds.client)) {
if (auth_debug_mode) {
printf("Kerberos V5: failure on principal (%s)\r\n",
if (newkey && (newkey->keytype != KEYTYPE_DES)) {
if (new_creds->keyblock.keytype == KEYTYPE_DES)
/* use the session key in credentials instead */
- krb5_copy_keyblock_contents(telnet_context, new_creds,
+ krb5_copy_keyblock_contents(telnet_context,
+ &new_creds->keyblock,
&session_key);
else
/* XXX ? */;
&server);
if (!r) {
+ krb5_rcache rcache;
+
+ r = krb5_get_server_rcache(telnet_context,
+ krb5_princ_component(telnet_context,
+ server, 0),
+ &rcache);
r = krb5_rd_req(telnet_context, &auth_context, &auth,
- server, NULL, NULL, &ticket);
+ server, telnet_srvtab, NULL, &ticket);
+ if (rcache)
+ krb5_rc_close(telnet_context, rcache);
krb5_free_principal(telnet_context, server);
}
if (r) {
return;
}
+ if (telnet_krb5_realm != NULL) {
+ krb5_data rdata;
+
+ rdata.length = strlen(telnet_krb5_realm);
+ rdata.data = (char *) malloc(rdata.length + 1);
+ if (rdata.data == NULL) {
+ fprintf(stderr, "malloc failed\n");
+ return;
+ }
+ strcpy(rdata.data, telnet_krb5_realm);
+ krb5_princ_set_realm(telnet_context, local_creds->server, &rdata);
+ }
+
if (r = krb5_cc_default(telnet_context, &ccache)) {
if (auth_debug_mode)
printf("Kerberos V5: could not get default ccache - %s\r\n",