new files
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2292 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		
							
								
								
									
										36
									
								
								appl/test/gss_common.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								appl/test/gss_common.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| #include "test_locl.h" | ||||
| #include <gssapi.h> | ||||
| RCSID("$Id$"); | ||||
|  | ||||
| void | ||||
| write_token (int sock, gss_buffer_t buf) | ||||
| { | ||||
|     u_int32_t len, net_len; | ||||
|     OM_uint32 min_stat; | ||||
|  | ||||
|     len = buf->length; | ||||
|  | ||||
|     net_len = htonl(len); | ||||
|  | ||||
|     if (write (sock, &net_len, 4) != 4) | ||||
| 	err (1, "write"); | ||||
|     if (write (sock, buf->value, len) != len) | ||||
| 	err (1, "write"); | ||||
|  | ||||
|     gss_release_buffer (&min_stat, buf); | ||||
| } | ||||
|  | ||||
| void | ||||
| read_token (int sock, gss_buffer_t buf) | ||||
| { | ||||
|     u_int32_t len, net_len; | ||||
|  | ||||
|     if (read(sock, &net_len, 4) != 4) | ||||
| 	err (1, "read"); | ||||
|     len = ntohl(net_len); | ||||
|     buf->length = len; | ||||
|     buf->value  = malloc(len); | ||||
|     if (read (sock, buf->value, len) != len) | ||||
| 	err (1, "read"); | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund