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/lib/rpc/unit-test | |
| 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/lib/rpc/unit-test')
| -rw-r--r-- | src/lib/rpc/unit-test/client.c | 19 | ||||
| -rw-r--r-- | src/lib/rpc/unit-test/server.c | 24 |
2 files changed, 21 insertions, 22 deletions
diff --git a/src/lib/rpc/unit-test/client.c b/src/lib/rpc/unit-test/client.c index 662a8c51c..df7144ab2 100644 --- a/src/lib/rpc/unit-test/client.c +++ b/src/lib/rpc/unit-test/client.c @@ -74,7 +74,7 @@ main(argc, argv) count = 1026; auth_once = 0; prot = NULL; - + while ((c = getopt(argc, argv, "a:m:os:tu")) != -1) { switch (c) { case 'a': @@ -120,20 +120,20 @@ main(argc, argv) default: usage(); } - + /* client handle to rstat */ clnt = clnt_create(host, RPC_TEST_PROG, RPC_TEST_VERS_1, prot); if (clnt == NULL) { clnt_pcreateerror(whoami); exit(1); } - + clnt->cl_auth = auth_gssapi_create_default(clnt, target); if (clnt->cl_auth == NULL) { clnt_pcreateerror(whoami); exit(2); } - + /* * Call the echo service multiple times. */ @@ -183,7 +183,7 @@ main(argc, argv) echo_resp = rpc_test_echo_1(&echo_arg, clnt); if (echo_resp == NULL) clnt_perror(clnt, "Sequence number improperly reset"); - + /* * Now simulate a lost server response, and see if * auth_gssapi_refresh recovers. @@ -193,7 +193,7 @@ main(argc, argv) echo_resp = rpc_test_echo_1(&echo_arg, clnt); if (echo_resp == NULL) clnt_perror(clnt, "Auto-resynchronization failed"); - + /* * Now make sure auto-resyncrhonization actually worked */ @@ -207,7 +207,7 @@ main(argc, argv) * unique. Create another context from the same credentials; it * should have the same expiration time and will cause the server * to abort if the clients are not differentiated. - * + * * Test fix for secure-rpc/586, part 2: btree keys cannot be * mutated in place. To test this: a second client, *with a * later expiration time*, must be run. The second client should @@ -238,7 +238,7 @@ main(argc, argv) AUTH_DESTROY(clnt->cl_auth); clnt->cl_auth = tmp_auth; } - + /* * Try RPC calls with argument/result lengths [0, 1025]. Do * this last, since it takes a while.. @@ -258,7 +258,7 @@ main(argc, argv) "RPC_TEST_LENGTHS call %d response wrong\n", i); gssrpc_xdr_free(xdr_wrapstring, echo_resp); } - + /* cycle from 1 to 255 */ buf[i] = (i % 255) + 1; @@ -273,4 +273,3 @@ main(argc, argv) CLNT_DESTROY(clnt); exit(0); } - diff --git a/src/lib/rpc/unit-test/server.c b/src/lib/rpc/unit-test/server.c index e373a3314..ee5446598 100644 --- a/src/lib/rpc/unit-test/server.c +++ b/src/lib/rpc/unit-test/server.c @@ -68,7 +68,7 @@ main(int argc, char **argv) extern int optind; #ifdef POSIX_SIGNALS struct sigaction sa; -#endif +#endif names[0].name = SERVICE_NAME; names[0].type = (gss_OID) gss_nt_service_name; @@ -118,13 +118,13 @@ main(int argc, char **argv) exit(1); } if (!svc_register(transp, RPC_TEST_PROG, RPC_TEST_VERS_1, - rpc_test_prog_1_svc, prot)) { + rpc_test_prog_1_svc, prot)) { fprintf(stderr, "unable to register (RPC_TEST_PROG, RPC_TEST_VERS_1, %s).", prot == IPPROTO_TCP ? "tcp" : "udp"); exit(1); } - + if (svcauth_gssapi_set_names(names, 0) == FALSE) { fprintf(stderr, "unable to set gssapi names\n"); exit(1); @@ -147,7 +147,7 @@ main(int argc, char **argv) signal(SIGTERM, handlesig); #endif printf("running\n"); - + svc_run(); fprintf(stderr, "svc_run returned"); exit(1); @@ -177,7 +177,7 @@ static void rpc_test_badverf(gss_name_t client, gss_name_t server, printf("rpc_test server: bad verifier from %.*s at %s:%d for %.*s\n", (int) client_name.length, (char *) client_name.value, - inet_ntoa(rqst->rq_xprt->xp_raddr.sin_addr), + inet_ntoa(rqst->rq_xprt->xp_raddr.sin_addr), ntohs(rqst->rq_xprt->xp_raddr.sin_port), (int) server_name.length, (char *) server_name.value); @@ -205,7 +205,7 @@ void rpc_test_badauth(OM_uint32 major, OM_uint32 minor, struct sockaddr_in *addr, caddr_t data) { char *a; - + /* Authentication attempt failed: <IP address>, <GSS-API error */ /* strings> */ @@ -220,7 +220,7 @@ void log_miscerr(struct svc_req *rqst, struct rpc_msg *msg, char *error, char *data) { char *a; - + a = inet_ntoa(rqst->rq_xprt->xp_raddr.sin_addr); printf("Miscellaneous RPC error: %s, %s\n", a, error); } @@ -243,19 +243,19 @@ void log_badauth_display_status_1(OM_uint32 code, int type, int rec) &msg_ctx, &msg); if (gssstat != GSS_S_COMPLETE) { if (!rec) { - log_badauth_display_status_1(gssstat,GSS_C_GSS_CODE,1); + log_badauth_display_status_1(gssstat,GSS_C_GSS_CODE,1); log_badauth_display_status_1(minor_stat, GSS_C_MECH_CODE, 1); } else printf("GSS-API authentication error %.*s: " - "recursive failure!\n", (int) msg.length, + "recursive failure!\n", (int) msg.length, (char *)msg.value); return; } - - printf(", %.*s", (int) msg.length, (char *)msg.value); + + printf(", %.*s", (int) msg.length, (char *)msg.value); (void) gss_release_buffer(&minor_stat, &msg); - + if (!msg_ctx) break; } |
