diff options
Diffstat (limited to 'gss-serv.c')
-rw-r--r-- | gss-serv.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/gss-serv.c b/gss-serv.c index 26eec25bd..e8191a859 100644 --- a/gss-serv.c +++ b/gss-serv.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: gss-serv.c,v 1.13 2005/10/13 22:24:31 stevesk Exp $ */ | 1 | /* $OpenBSD: gss-serv.c,v 1.20 2006/08/03 03:34:42 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. | 4 | * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. |
@@ -28,14 +28,21 @@ | |||
28 | 28 | ||
29 | #ifdef GSSAPI | 29 | #ifdef GSSAPI |
30 | 30 | ||
31 | #include "bufaux.h" | 31 | #include <sys/types.h> |
32 | |||
33 | #include <stdarg.h> | ||
34 | #include <string.h> | ||
35 | #include <unistd.h> | ||
36 | |||
37 | #include "xmalloc.h" | ||
38 | #include "buffer.h" | ||
39 | #include "key.h" | ||
40 | #include "hostfile.h" | ||
32 | #include "auth.h" | 41 | #include "auth.h" |
33 | #include "log.h" | 42 | #include "log.h" |
34 | #include "channels.h" | 43 | #include "channels.h" |
35 | #include "session.h" | 44 | #include "session.h" |
36 | #include "servconf.h" | 45 | #include "misc.h" |
37 | #include "xmalloc.h" | ||
38 | #include "getput.h" | ||
39 | 46 | ||
40 | #include "ssh-gss.h" | 47 | #include "ssh-gss.h" |
41 | 48 | ||
@@ -78,6 +85,8 @@ ssh_gssapi_supported_oids(gss_OID_set *oidset) | |||
78 | &supported_mechs[i]->oid, oidset); | 85 | &supported_mechs[i]->oid, oidset); |
79 | i++; | 86 | i++; |
80 | } | 87 | } |
88 | |||
89 | gss_release_oid_set(&min_status, &supported); | ||
81 | } | 90 | } |
82 | 91 | ||
83 | 92 | ||
@@ -151,7 +160,7 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name) | |||
151 | * second without. | 160 | * second without. |
152 | */ | 161 | */ |
153 | 162 | ||
154 | oidl = GET_16BIT(tok+2); /* length including next two bytes */ | 163 | oidl = get_u16(tok+2); /* length including next two bytes */ |
155 | oidl = oidl-2; /* turn it into the _real_ length of the variable OID */ | 164 | oidl = oidl-2; /* turn it into the _real_ length of the variable OID */ |
156 | 165 | ||
157 | /* | 166 | /* |
@@ -168,14 +177,14 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name) | |||
168 | if (ename->length < offset+4) | 177 | if (ename->length < offset+4) |
169 | return GSS_S_FAILURE; | 178 | return GSS_S_FAILURE; |
170 | 179 | ||
171 | name->length = GET_32BIT(tok+offset); | 180 | name->length = get_u32(tok+offset); |
172 | offset += 4; | 181 | offset += 4; |
173 | 182 | ||
174 | if (ename->length < offset+name->length) | 183 | if (ename->length < offset+name->length) |
175 | return GSS_S_FAILURE; | 184 | return GSS_S_FAILURE; |
176 | 185 | ||
177 | name->value = xmalloc(name->length+1); | 186 | name->value = xmalloc(name->length+1); |
178 | memcpy(name->value, tok+offset,name->length); | 187 | memcpy(name->value, tok+offset, name->length); |
179 | ((char *)name->value)[name->length] = 0; | 188 | ((char *)name->value)[name->length] = 0; |
180 | 189 | ||
181 | return GSS_S_COMPLETE; | 190 | return GSS_S_COMPLETE; |
@@ -234,7 +243,8 @@ ssh_gssapi_cleanup_creds(void) | |||
234 | { | 243 | { |
235 | if (gssapi_client.store.filename != NULL) { | 244 | if (gssapi_client.store.filename != NULL) { |
236 | /* Unlink probably isn't sufficient */ | 245 | /* Unlink probably isn't sufficient */ |
237 | debug("removing gssapi cred file\"%s\"", gssapi_client.store.filename); | 246 | debug("removing gssapi cred file\"%s\"", |
247 | gssapi_client.store.filename); | ||
238 | unlink(gssapi_client.store.filename); | 248 | unlink(gssapi_client.store.filename); |
239 | } | 249 | } |
240 | } | 250 | } |