+2001-11-01 Sam Hartman <hartmans@mit.edu>
+
+ * gss-server.c gss-client.c: ONly free buffers returned from
+ GSSAPI using gss_release_buffer
+
+ * gss-client.c (client_establish_context): Trailing null should
+ not be part of service name
+
2001-10-09 Ken Raeburn <raeburn@mit.edu>
* gss-misc.c, gss-misc.h: Make prototypes unconditional.
* local variable space.
*/
send_tok.value = service_name;
- send_tok.length = strlen(service_name) + 1;
+ send_tok.length = strlen(service_name) ;
maj_stat = gss_import_name(&min_stat, &send_tok,
(gss_OID) gss_nt_service_name, &target_name);
if (maj_stat != GSS_S_COMPLETE) {
NULL); /* ignore time_rec */
if (token_ptr != GSS_C_NO_BUFFER)
- (void) gss_release_buffer(&min_stat, &recv_tok);
+ free (recv_tok.value);
if (send_tok.length != 0) {
if (verbose)
printf("Response received.\n");
}
- (void) gss_release_buffer(&min_stat, &out_buf);
+ free (out_buf.value);
}
if (use_file)
if (recv_token(s, &token_flags, &recv_tok) < 0)
return -1;
- (void) gss_release_buffer(&min_stat, &recv_tok);
+ if (recv_tok.value) {
+ free (recv_tok.value);
+ recv_tok.value = NULL;
+ }
if (! (token_flags & TOKEN_NOOP)) {
if (log)
fprintf(log, "Expected NOOP token, got %d token instead\n",
NULL, /* ignore time_rec */
NULL); /* ignore del_cred_handle */
- (void) gss_release_buffer(&min_stat, &recv_tok);
+ free(recv_tok.value);
if (send_tok.length != 0) {
if (verbose && log) {
if (log)
fprintf(log,
"Unauthenticated client requested authenticated services!\n");
- (void) gss_release_buffer(&min_stat, &xmit_buf);
+ free (xmit_buf.value);
return(-1);
}
&conf_state, (gss_qop_t *) NULL);
if (maj_stat != GSS_S_COMPLETE) {
display_status("unsealing message", maj_stat, min_stat);
- (void) gss_release_buffer(&min_stat, &xmit_buf);
+ free (xmit_buf.value);
return(-1);
} else if (! conf_state && (token_flags & TOKEN_ENCRYPTED)) {
fprintf(stderr, "Warning! Message not encrypted.\n");
}
- (void) gss_release_buffer(&min_stat, &xmit_buf);
+ free (xmit_buf.value);
}
else {
msg_buf = xmit_buf;
display_status("signing message", maj_stat, min_stat);
return(-1);
}
-
- (void) gss_release_buffer(&min_stat, &msg_buf);
+if (token_flags & TOKEN_WRAPPED)
+ free (xmit_buf.value);
/* Send the signature block to the client */
if (send_token(s, TOKEN_MIC, &xmit_buf) < 0)
(void) gss_release_buffer(&min_stat, &xmit_buf);
}
else {
- (void) gss_release_buffer(&min_stat, &msg_buf);
+ if (token_flags & TOKEN_WRAPPED)
+ free (xmit_buf.value);
if (send_token(s, TOKEN_NOOP, empty_token) < 0)
return(-1);
}