summaryrefslogtreecommitdiff
path: root/gss-serv.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-09-02 22:56:42 +1000
committerDamien Miller <djm@mindrot.org>2003-09-02 22:56:42 +1000
commit134350c20c7e4aa428f9dbe8f9ba36e6027cfc1f (patch)
tree23120f4396f6677fde498c5571651e5f28f4f564 /gss-serv.c
parenta0c4ad21b67c4d27678550508e049a0a24f89cad (diff)
- markus@cvs.openbsd.org 2003/08/31 13:31:57
[gss-serv.c] whitspace KNF
Diffstat (limited to 'gss-serv.c')
-rw-r--r--gss-serv.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/gss-serv.c b/gss-serv.c
index 8eb20e955..8fd1d63f0 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv.c,v 1.2 2003/08/31 13:30:18 markus Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.3 2003/08/31 13:31:57 markus 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.
@@ -137,15 +137,15 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name)
137 char *tok; 137 char *tok;
138 OM_uint32 offset; 138 OM_uint32 offset;
139 OM_uint32 oidl; 139 OM_uint32 oidl;
140 140
141 tok=ename->value; 141 tok=ename->value;
142 142
143 /* 143 /*
144 * Check that ename is long enough for all of the fixed length 144 * Check that ename is long enough for all of the fixed length
145 * header, and that the initial ID bytes are correct 145 * header, and that the initial ID bytes are correct
146 */ 146 */
147 147
148 if (ename->length<6 || memcmp(tok,"\x04\x01", 2)!=0) 148 if (ename->length<6 || memcmp(tok,"\x04\x01", 2)!=0)
149 return GSS_S_FAILURE; 149 return GSS_S_FAILURE;
150 150
151 /* 151 /*
@@ -163,27 +163,27 @@ ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name)
163 * string is long enough and that the OID matches that in our context 163 * string is long enough and that the OID matches that in our context
164 */ 164 */
165 if (tok[4] != 0x06 || tok[5] != oidl || 165 if (tok[4] != 0x06 || tok[5] != oidl ||
166 ename->length < oidl+6 || 166 ename->length < oidl+6 ||
167 !ssh_gssapi_check_oid(ctx,tok+6,oidl)) 167 !ssh_gssapi_check_oid(ctx,tok+6,oidl))
168 return GSS_S_FAILURE; 168 return GSS_S_FAILURE;
169 169
170 offset = oidl+6; 170 offset = oidl+6;
171 171
172 if (ename->length < offset+4) 172 if (ename->length < offset+4)
173 return GSS_S_FAILURE; 173 return GSS_S_FAILURE;
174 174
175 name->length = GET_32BIT(tok+offset); 175 name->length = GET_32BIT(tok+offset);
176 offset += 4; 176 offset += 4;
177 177
178 if (ename->length < offset+name->length) 178 if (ename->length < offset+name->length)
179 return GSS_S_FAILURE; 179 return GSS_S_FAILURE;
180 180
181 name->value = xmalloc(name->length+1); 181 name->value = xmalloc(name->length+1);
182 memcpy(name->value,tok+offset,name->length); 182 memcpy(name->value,tok+offset,name->length);
183 ((char *)name->value)[name->length] = 0; 183 ((char *)name->value)[name->length] = 0;
184 184
185 return GSS_S_COMPLETE; 185 return GSS_S_COMPLETE;
186} 186}
187 187
188/* Extract the client details from a given context. This can only reliably 188/* Extract the client details from a given context. This can only reliably
189 * be called once for a context */ 189 * be called once for a context */
@@ -195,7 +195,7 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
195 int i = 0; 195 int i = 0;
196 196
197 gss_buffer_desc ename; 197 gss_buffer_desc ename;
198 198
199 client->mech = NULL; 199 client->mech = NULL;
200 200
201 while (supported_mechs[i]->name != NULL) { 201 while (supported_mechs[i]->name != NULL) {
@@ -206,21 +206,21 @@ ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
206 i++; 206 i++;
207 } 207 }
208 208
209 if (client->mech == NULL) 209 if (client->mech == NULL)
210 return GSS_S_FAILURE; 210 return GSS_S_FAILURE;
211 211
212 if ((ctx->major = gss_display_name(&ctx->minor, ctx->client, 212 if ((ctx->major = gss_display_name(&ctx->minor, ctx->client,
213 &client->displayname, NULL))) { 213 &client->displayname, NULL))) {
214 ssh_gssapi_error(ctx); 214 ssh_gssapi_error(ctx);
215 return (ctx->major); 215 return (ctx->major);
216 } 216 }
217 217
218 if ((ctx->major = gss_export_name(&ctx->minor, ctx->client, 218 if ((ctx->major = gss_export_name(&ctx->minor, ctx->client,
219 &ename))) { 219 &ename))) {
220 ssh_gssapi_error(ctx); 220 ssh_gssapi_error(ctx);
221 return (ctx->major); 221 return (ctx->major);
222 } 222 }
223 223
224 if ((ctx->major = ssh_gssapi_parse_ename(ctx,&ename, 224 if ((ctx->major = ssh_gssapi_parse_ename(ctx,&ename,
225 &client->exportedname))) { 225 &client->exportedname))) {
226 return (ctx->major); 226 return (ctx->major);