+Thu Jul 21 01:02:28 1994 Tom Yu (tlyu at dragons-lair)
+
+ * Makefile.in: fix infinite recursion in rules
+ * gss-client.c:
+ * gss-misc.c:
+ * gss-server.c: downgrade to K&R function definitions
+
Tue Jul 19 20:28:46 1994 Tom Yu (tlyu at dragons-lair)
* Makefile.in:
COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a
DBMLIB=
-all::
+all:: gss-server gss-client
KLIB = $(TOPLIBD)/gssapi/libgssapi_krb5.a $(TOPLIBD)/libkrb5.a \
$(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB) $(DBMLIB)
gss-client: gss-client.o gss-misc.o
$(CC) $(CFLAGS) -o gss-client gss-client.o gss-misc.o $(KLIB) $(LIBS)
-gss-client.o: $(srcdir)/gss-client.o
-
-gss-misc.o: $(srcdir)/gss-misc.o
+gss-client.o: $(srcdir)/gss-client.c
-gss-server.o: $(srcdir)/gss-server.o
+gss-misc.o: $(srcdir)/gss-misc.c
-all:: gss-server gss-client
+gss-server.o: $(srcdir)/gss-server.c
clean::
$(RM) gss-server gss-client
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
-int establish_context(int s, char *service_name, gss_ctx_id_t *gss_context);
-int connect_to_server(char *host, u_short port);
-int call_server(char *host, u_short port, char *service_name, char *msg);
+int establish_context();
+int connect_to_server();
+int call_server();
-int send_token(int s, gss_buffer_t tok);
-int recv_token(int s, gss_buffer_t tok);
-void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat);
+int send_token();
+int recv_token();
+void display_status();
usage()
{
exit(1);
}
-main(int argc, char **argv)
+main(argc, argv)
+ int argc;
+ char **argv;
{
char *service_name, *server_host, *msg;
u_short port = 4444;
* verifies it with gss_verify. -1 is returned if any step fails,
* otherwise 0 is returned.
*/
-int call_server(char *host, u_short port, char *service_name, char *msg)
+int call_server(host, port, service_name, msg)
+ char *host;
+ u_short port;
+ char *service_name;
+ char *msg;
{
gss_ctx_id_t context;
gss_buffer_desc in_buf, out_buf;
* opened and connected. If an error occurs, an error message is
* displayed and -1 is returned.
*/
-int connect_to_server(char *host, u_short port)
+int connect_to_server(host, port)
+ char *host;
+ u_short port;
{
struct sockaddr_in saddr;
struct hostent *hp;
* unsuccessful, the GSS-API error messages are displayed on stderr
* and -1 is returned.
*/
-int client_establish_context(int s, char *service_name,
- gss_ctx_id_t *gss_context)
+int client_establish_context(s, service_name, gss_context)
+ int s;
+ char *service_name;
+ gss_ctx_id_t *gss_context;
{
gss_buffer_desc send_tok, recv_tok, *token_ptr;
gss_name_t target_name;
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
-static void display_status_1(char *m, OM_uint32 code, int type);
+static void display_status_1();
/*
* Function: send_token
* token data to the file descriptor s. It returns 0 on success, and
* -1 if an error occurs or if it could not write all the data.
*/
-int send_token(int s, gss_buffer_t tok)
+int send_token(s, tok)
+ int s;
+ gss_buffer_t tok;
{
int len, ret;
* gss_release_buffer. It returns 0 on success, and -1 if an error
* occurs or if it could not read all the data.
*/
-int recv_token(int s, gss_buffer_t tok)
+int recv_token(s, tok)
+ int s;
+ gss_buffer_t tok;
{
int ret;
* displayed on stderr, each preceeded by "GSS-API error <msg>: " and
* followed by a newline.
*/
-void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat)
+void display_status(msg, maj_stat, min_stat)
+ char *msg;
+ OM_uint32 maj_stat;
+ OM_uint32 min_stat;
{
display_status_1(msg, maj_stat, GSS_C_GSS_CODE);
display_status_1(msg, min_stat, GSS_C_MECH_CODE);
}
-static void display_status_1(char *m, OM_uint32 code, int type)
+static void display_status_1(m, code, type)
+ char *m;
+ OM_uint32 code;
+ int type;
{
OM_uint32 maj_stat, min_stat;
gss_buffer_desc msg;
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
-int create_socket(u_short port);
+int create_socket();
-int send_token(int s, gss_buffer_t tok);
-int recv_token(int s, gss_buffer_t tok);
-void display_status(char *msg, OM_uint32 maj_stat, OM_uint32 min_stat);
+int send_token();
+int recv_token();
+void display_status();
usage()
{
exit(1);
}
-main(int argc, char **argv)
+main(argc, argv)
+ int argc;
+ char **argv;
{
struct sockaddr_in saddr;
char *service_name;
* A listening socket on the specified port and created and returned.
* On error, an error message is displayed and -1 is returned.
*/
-int create_socket(u_short port)
+int create_socket(port)
+ u_short port;
{
struct sockaddr_in saddr;
int s;
*
* If any error occurs, -1 is returned.
*/
-int sign_server(int s, char *service_name)
+int sign_server(s, service_name)
+ int s;
+ char *service_name;
{
gss_cred_id_t server_creds;
gss_buffer_desc client_name, xmit_buf, msg_buf;
* fails, an error message is displayed and -1 is returned; otherwise,
* 0 is returned.
*/
-int server_acquire_creds(char *service_name, gss_cred_id_t *server_creds)
+int server_acquire_creds(service_name, server_creds)
+ char *service_name;
+ gss_cred_id_t *server_creds;
{
gss_buffer_desc name_buf;
gss_name_t server_name;
* in client_name and 0 is returned. If unsuccessful, an error
* message is displayed and -1 is returned.
*/
-int server_establish_context(int s, gss_cred_id_t server_creds,
- gss_ctx_id_t *context, gss_buffer_t
- client_name)
+int server_establish_context(s, server_creds, context, client_name)
+ int s;
+ gss_cred_id_t server_creds;
+ gss_ctx_id_t *context;
+ gss_buffer_t client_name;
{
gss_buffer_desc send_tok, recv_tok;
gss_name_t client;