diff options
author | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2009-10-31 00:48:38 +0000 |
commit | 02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b (patch) | |
tree | 61b9147863cd8be3eff63903dc36cae168254bd5 /src/appl/telnet/libtelnet | |
parent | 162ab371748cba0cc6f172419bd6e71fa04bb878 (diff) | |
download | krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.gz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.tar.xz krb5-02d6bcbc98a214e7aeaaa9f45f0db8784a7b743b.zip |
make mark-cstyle
make reindent
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23100 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl/telnet/libtelnet')
-rw-r--r-- | src/appl/telnet/libtelnet/auth-proto.h | 2 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/auth.c | 8 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/enc_des.c | 18 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/encrypt.c | 14 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/forward.c | 10 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/kerberos5.c | 52 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/krb5forw.h | 5 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/mem.c | 2 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/parsetos.c | 1 | ||||
-rw-r--r-- | src/appl/telnet/libtelnet/setenv.c | 2 |
10 files changed, 56 insertions, 58 deletions
diff --git a/src/appl/telnet/libtelnet/auth-proto.h b/src/appl/telnet/libtelnet/auth-proto.h index faf806fad7..c0d666d119 100644 --- a/src/appl/telnet/libtelnet/auth-proto.h +++ b/src/appl/telnet/libtelnet/auth-proto.h @@ -40,7 +40,7 @@ * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. - * + * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright diff --git a/src/appl/telnet/libtelnet/auth.c b/src/appl/telnet/libtelnet/auth.c index aed6887992..a8801960f4 100644 --- a/src/appl/telnet/libtelnet/auth.c +++ b/src/appl/telnet/libtelnet/auth.c @@ -36,7 +36,7 @@ /* * Copyright (C) 1990 by the Massachusetts Institute of Technology * - * Export of this software from the United States of America may + * Export of this software from the United States of America may * require a specific license from the United States Government. * It is the responsibility of any person or organization contemplating * export to obtain such a license before exporting. @@ -126,7 +126,7 @@ Authenticator authenticators[] = { kerberos5_reply, kerberos5_status, kerberos5_printsub }, -#endif +#endif { AUTHTYPE_KERBEROS_V5, AUTH_WHO_CLIENT|AUTH_HOW_MUTUAL, kerberos5_init, kerberos5_send, @@ -399,7 +399,7 @@ void auth_send_retry() static unsigned char str_none[] = { IAC, SB, TELOPT_AUTHENTICATION, TELQUAL_IS, AUTHTYPE_NULL, 0, IAC, SE }; - + if (Server) { if (auth_debug_mode) { printf(">>>%s: auth_send_retry called!\r\n", Name); @@ -445,7 +445,7 @@ void auth_send_retry() * We requested strong authentication, however no mechanisms worked. * Therefore, exit on client end. */ - printf("Unable to securely authenticate user ... exit\n"); + printf("Unable to securely authenticate user ... exit\n"); exit(0); #endif /* KANNAN */ } diff --git a/src/appl/telnet/libtelnet/enc_des.c b/src/appl/telnet/libtelnet/enc_des.c index 6dd48b696d..9c20eb0d9f 100644 --- a/src/appl/telnet/libtelnet/enc_des.c +++ b/src/appl/telnet/libtelnet/enc_des.c @@ -33,14 +33,14 @@ /* * Copyright (C) 1998 by the FundsXpress, INC. - * + * * All rights reserved. - * + * * Export of this software from the United States of America may require * a specific license from the United States Government. It is the * responsibility of any person or organization contemplating export to * obtain such a license before exporting. - * + * * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and * distribute this software and its documentation for any purpose and * without fee is hereby granted, provided that the above copyright @@ -51,7 +51,7 @@ * permission. FundsXpress makes no representations about the suitability of * this software for any purpose. It is provided "as is" without express * or implied warranty. - * + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. @@ -149,7 +149,7 @@ int fb64_reply (unsigned char *, int, struct fb *); static void fb64_session (Session_Key *, int, struct fb *); void fb64_stream_key (Block, struct stinfo *); int fb64_keyid (int, unsigned char *, int *, struct fb *); -void fb64_printsub (unsigned char *, int, unsigned char *, int, +void fb64_printsub (unsigned char *, int, unsigned char *, int, unsigned char *); static void ecb_encrypt(stp, in, out) @@ -160,7 +160,7 @@ static void ecb_encrypt(stp, in, out) krb5_error_code code; krb5_data din; krb5_enc_data dout; - + din.length = 8; din.data = in; @@ -634,7 +634,7 @@ fb64_stream_key(key, stp) * INPUT --(--------->(+)+---> DATA * | | * +-------------+ - * + * * * Given: * iV: Initial vector, 64 bits (8 bytes) long. @@ -695,7 +695,7 @@ cfb64_decrypt(data) ecb_encrypt(stp, stp->str_output, b); memcpy(stp->str_feed, b, sizeof(Block)); stp->str_index = 1; /* Next time will be 1 */ - idx = 0; /* But now use 0 */ + idx = 0; /* But now use 0 */ } /* On decryption we store (data) which is cypher. */ @@ -768,7 +768,7 @@ ofb64_decrypt(data) ecb_encrypt(stp, stp->str_feed, b); memcpy(stp->str_feed, b, sizeof(Block)); stp->str_index = 1; /* Next time will be 1 */ - idx = 0; /* But now use 0 */ + idx = 0; /* But now use 0 */ } return(data ^ stp->str_feed[idx]); diff --git a/src/appl/telnet/libtelnet/encrypt.c b/src/appl/telnet/libtelnet/encrypt.c index 6317eceb30..19e855d3ca 100644 --- a/src/appl/telnet/libtelnet/encrypt.c +++ b/src/appl/telnet/libtelnet/encrypt.c @@ -108,7 +108,7 @@ static long remote_supports_decrypt = 0; static Encryptions encryptions[] = { #ifdef DES_ENCRYPTION { "DES_CFB64", ENCTYPE_DES_CFB64, - cfb64_encrypt, + cfb64_encrypt, cfb64_decrypt, cfb64_init, cfb64_start, @@ -118,7 +118,7 @@ static Encryptions encryptions[] = { cfb64_keyid, cfb64_printsub }, { "DES_OFB64", ENCTYPE_DES_OFB64, - ofb64_encrypt, + ofb64_encrypt, ofb64_decrypt, ofb64_init, ofb64_start, @@ -563,7 +563,7 @@ encrypt_is(data, cnt) } else { ret = (*ep->is)(data, cnt); if (encrypt_debug_mode) - printf("(*ep->is)(%lx, %d) returned %s(%d)\n", + printf("(*ep->is)(%lx, %d) returned %s(%d)\n", (unsigned long) data, cnt, (ret < 0) ? "FAIL " : (ret == 0) ? "SUCCESS " : "MORE_TO_DO ", ret); @@ -713,7 +713,7 @@ encrypt_request_end() * Called when ENCRYPT REQUEST-START is received. If we receive * this before a type is picked, then that indicates that the * other side wants us to start encrypting data as soon as we - * can. + * can. */ void encrypt_request_start(data, cnt) @@ -731,7 +731,7 @@ encrypt_request_start(data, cnt) static unsigned char str_keyid[(MAXKEYLEN*2)+5] = { IAC, SB, TELOPT_ENCRYPT }; static void encrypt_keyid (struct key_info *kp, unsigned char *, unsigned int); - + void encrypt_enc_keyid(keyid, len) unsigned char *keyid; int len; @@ -769,7 +769,7 @@ static void encrypt_keyid(kp, keyid, len) if (ep->keyid) (void)(*ep->keyid)(dir, kp->keyid, &kp->keylen); - } else if ((len != kp->keylen) || + } else if ((len != kp->keylen) || (memcmp(keyid, kp->keyid, len) != 0)) { /* * Length or contents are different @@ -858,7 +858,7 @@ encrypt_start_output(type) i = (*ep->start)(DIR_ENCRYPT, Server); if (encrypt_debug_mode) { printf(">>>%s: Encrypt start: %s (%d) %s\r\n", - Name, + Name, (i < 0) ? "failed" : "initial negotiation in progress", i, ENCTYPE_NAME(type)); diff --git a/src/appl/telnet/libtelnet/forward.c b/src/appl/telnet/libtelnet/forward.c index 98dcb78972..98afb395d8 100644 --- a/src/appl/telnet/libtelnet/forward.c +++ b/src/appl/telnet/libtelnet/forward.c @@ -21,7 +21,7 @@ /* General-purpose forwarding routines. These routines may be put into */ -/* libkrb5.a to allow widespread use */ +/* libkrb5.a to allow widespread use */ #if defined(KERBEROS) || defined(KRB5) #include <stdio.h> @@ -29,12 +29,12 @@ #ifdef HAVE_UNISTD_H #include <unistd.h> #endif - + #include "krb5.h" #include <errno.h> #include "krb5forw.h" - + #if defined(NEED_SETENV) || defined(NEED_SETENV_PROTO) extern int setenv(char *, char *, int); #endif @@ -63,11 +63,11 @@ rd_and_store_for_creds(context, auth_context, inbuf, ticket) if ((retval = krb5_cc_resolve(context, ccname, &ccache))) goto cleanup; - if ((retval = krb5_cc_initialize(context, ccache, + if ((retval = krb5_cc_initialize(context, ccache, ticket->enc_part2->client))) goto cleanup; - if ((retval = krb5_cc_store_cred(context, ccache, *creds))) + if ((retval = krb5_cc_store_cred(context, ccache, *creds))) goto cleanup; cleanup: diff --git a/src/appl/telnet/libtelnet/kerberos5.c b/src/appl/telnet/libtelnet/kerberos5.c index 77a1b5a6d7..bc3cecf872 100644 --- a/src/appl/telnet/libtelnet/kerberos5.c +++ b/src/appl/telnet/libtelnet/kerberos5.c @@ -83,7 +83,7 @@ extern char *malloc(); #else #include <strings.h> #endif - + #include "encrypt.h" #include "auth.h" #include "misc.h" @@ -182,7 +182,7 @@ kerberos5_init(ap, server) int server; { krb5_error_code retval; - + if (server) str_data[3] = TELQUAL_REPLY; else @@ -201,7 +201,7 @@ kerberos5_cleanup() krb5_error_code retval; krb5_ccache ccache; char *ccname; - + if (telnet_context == 0) return; @@ -306,7 +306,7 @@ kerberos5_send(ap) #ifdef ENCRYPTION ap_opts |= AP_OPTS_USE_SUBKEY; #endif /* ENCRYPTION */ - + if (auth_context) { krb5_auth_con_free(telnet_context, auth_context); auth_context = 0; @@ -318,10 +318,10 @@ kerberos5_send(ap) } return(0); } - + krb5_auth_con_setflags(telnet_context, auth_context, KRB5_AUTH_CONTEXT_RET_TIME); - + type_check[0] = ap->type; type_check[1] = ap->way; check_data.magic = KV5M_DATA; @@ -366,7 +366,7 @@ kerberos5_send(ap) return(0); } - if (!auth_sendname((unsigned char *) UserNameRequested, + if (!auth_sendname((unsigned char *) UserNameRequested, (int) strlen(UserNameRequested))) { if (auth_debug_mode) printf("telnet: Not enough room for user name\r\n"); @@ -415,7 +415,7 @@ kerberos5_is(ap, data, cnt) r = krb5_auth_con_init(telnet_context, &auth_context); if (!r) { krb5_rcache rcache; - + r = krb5_auth_con_getrcache(telnet_context, auth_context, &rcache); if (!r && !rcache) { @@ -434,7 +434,7 @@ kerberos5_is(ap, data, cnt) auth_context, rcache); } if (!r && telnet_srvtab) - r = krb5_kt_resolve(telnet_context, + r = krb5_kt_resolve(telnet_context, telnet_srvtab, &keytabid); if (!r) r = krb5_rd_req(telnet_context, &auth_context, &auth, @@ -458,10 +458,10 @@ kerberos5_is(ap, data, cnt) } if (krb5_princ_component(telnet_context,ticket->server,0)->length < 256) { char princ[256]; - strncpy(princ, + strncpy(princ, krb5_princ_component(telnet_context, ticket->server,0)->data, krb5_princ_component(telnet_context, ticket->server,0)->length); - princ[krb5_princ_component(telnet_context, + princ[krb5_princ_component(telnet_context, ticket->server,0)->length] = '\0'; if (strcmp("host", princ)) { if(strlen(princ) < sizeof(errbuf) - 39) { @@ -543,8 +543,8 @@ kerberos5_is(ap, data, cnt) } Data(ap, KRB_RESPONSE, outbuf.data, outbuf.length); - } - if (krb5_unparse_name(telnet_context, + } + if (krb5_unparse_name(telnet_context, ticket->enc_part2 ->client, &name)) name = 0; @@ -555,7 +555,7 @@ kerberos5_is(ap, data, cnt) name ? name : ""); } auth_finished(ap, AUTH_USER); - + if (name) free(name); krb5_auth_con_getrecvsubkey(telnet_context, auth_context, @@ -572,7 +572,7 @@ kerberos5_is(ap, data, cnt) ticket->enc_part2->session, &session_key); } - + #ifdef ENCRYPTION skey.type = SK_DES; skey.length = 8; @@ -584,8 +584,8 @@ kerberos5_is(ap, data, cnt) case KRB_FORWARD: inbuf.length = cnt; inbuf.data = (char *)data; - if ((r = krb5_auth_con_genaddrs(telnet_context, auth_context, - net, KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR)) || + if ((r = krb5_auth_con_genaddrs(telnet_context, auth_context, + net, KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR)) || (r = rd_and_store_for_creds(telnet_context, auth_context, &inbuf, ticket))) { @@ -599,7 +599,7 @@ kerberos5_is(ap, data, cnt) printf( "telnetd: Could not read forwarded credentials\r\n"); } - else + else Data(ap, KRB_FORWARD_ACCEPT, 0, 0); if (auth_debug_mode) printf("telnetd: Forwarded credentials obtained\r\n"); @@ -613,7 +613,7 @@ kerberos5_is(ap, data, cnt) break; } return; - + errout: { char eerrbuf[329]; @@ -745,7 +745,7 @@ kerberos5_status(ap, name, level) } if (UserNameRequested && - krb5_kuserok(telnet_context, ticket->enc_part2->client, + krb5_kuserok(telnet_context, ticket->enc_part2->client, UserNameRequested)) { return(AUTH_VALID); @@ -839,14 +839,14 @@ kerberos5_forward(ap) forw_creds.data = 0; if ((r = krb5_cc_default(telnet_context, &ccache))) { - if (auth_debug_mode) + if (auth_debug_mode) printf("Kerberos V5: could not get default ccache - %s\r\n", error_message(r)); return; } if ((r = krb5_cc_get_principal(telnet_context, ccache, &client))) { - if (auth_debug_mode) + if (auth_debug_mode) printf("Kerberos V5: could not get default principal - %s\r\n", error_message(r)); goto cleanup; @@ -854,7 +854,7 @@ kerberos5_forward(ap) if ((r = krb5_sname_to_principal(telnet_context, RemoteHostName, "host", KRB5_NT_SRV_HST, &server))) { - if (auth_debug_mode) + if (auth_debug_mode) printf("Kerberos V5: could not make server principal - %s\r\n", error_message(r)); goto cleanup; @@ -872,12 +872,12 @@ kerberos5_forward(ap) server, ccache, forward_flags & OPTS_FORWARDABLE_CREDS, &forw_creds))) { - if (auth_debug_mode) + if (auth_debug_mode) printf("Kerberos V5: error getting forwarded creds - %s\r\n", error_message(r)); goto cleanup; } - + /* Send forwarded credentials */ if (!Data(ap, KRB_FORWARD, forw_creds.data, forw_creds.length)) { if (auth_debug_mode) @@ -886,7 +886,7 @@ kerberos5_forward(ap) if (auth_debug_mode) printf("Forwarded local Kerberos V5 credentials to server\r\n"); } - + cleanup: if (client) krb5_free_principal(telnet_context, client); diff --git a/src/appl/telnet/libtelnet/krb5forw.h b/src/appl/telnet/libtelnet/krb5forw.h index 1fb757ddf9..4984d35b85 100644 --- a/src/appl/telnet/libtelnet/krb5forw.h +++ b/src/appl/telnet/libtelnet/krb5forw.h @@ -1,4 +1,3 @@ -extern krb5_error_code -rd_and_store_for_creds(krb5_context, krb5_auth_context, krb5_data *, +extern krb5_error_code +rd_and_store_for_creds(krb5_context, krb5_auth_context, krb5_data *, krb5_ticket *); - diff --git a/src/appl/telnet/libtelnet/mem.c b/src/appl/telnet/libtelnet/mem.c index 5a2ced8d5a..4a1239dac7 100644 --- a/src/appl/telnet/libtelnet/mem.c +++ b/src/appl/telnet/libtelnet/mem.c @@ -141,7 +141,7 @@ memset(dst0, c0, length) * * but we use a minimum of 3 here since the overhead of the code * to do word writes is substantial. - */ + */ if (length < 3 * wsize) { while (length != 0) { *dst++ = VAL; diff --git a/src/appl/telnet/libtelnet/parsetos.c b/src/appl/telnet/libtelnet/parsetos.c index 303d7c3e52..92a3afc9fd 100644 --- a/src/appl/telnet/libtelnet/parsetos.c +++ b/src/appl/telnet/libtelnet/parsetos.c @@ -1,4 +1,3 @@ - /* * The routine parsetos() for UNICOS 6.0/6.1, as well as more traditional * Unix systems. This is part of UNICOS 7.0 and later. diff --git a/src/appl/telnet/libtelnet/setenv.c b/src/appl/telnet/libtelnet/setenv.c index 941b816cad..a917af1cf4 100644 --- a/src/appl/telnet/libtelnet/setenv.c +++ b/src/appl/telnet/libtelnet/setenv.c @@ -44,7 +44,7 @@ #include "misc-proto.h" -static char *__findenv (const char *, int *); +static char *__findenv (const char *, int *); /* * setenv -- |