3 /* $KAME: gssapi.c,v 1.19 2001/04/03 15:51:55 thorpej Exp $ */
6 * Copyright 2000 Wasabi Systems, Inc.
9 * This software was written by Frank van der Linden of Wasabi Systems
10 * for Zembu Labs, Inc. http://www.zembu.com/
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. The name of Wasabi Systems, Inc. may not be used to endorse
21 * or promote products derived from this software without specific prior
24 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
41 #include <sys/types.h>
42 #include <sys/queue.h>
43 #include <sys/socket.h>
59 #include "localconf.h"
60 #include "remoteconf.h"
61 #include "isakmp_var.h"
65 #include "ipsec_doi.h"
66 #include "crypto_openssl.h"
68 #include "isakmp_ident.h"
69 #include "isakmp_inf.h"
76 gssapi_error(OM_uint32 status_code
, const char *where
,
79 OM_uint32 message_context
, maj_stat
, min_stat
;
80 gss_buffer_desc status_string
;
84 plogv(LLV_ERROR
, where
, NULL
, fmt
, ap
);
90 maj_stat
= gss_display_status(&min_stat
, status_code
,
91 GSS_C_MECH_CODE
, GSS_C_NO_OID
, &message_context
,
93 if (GSS_ERROR(maj_stat
))
94 plog(LLV_ERROR
, LOCATION
, NULL
,
95 "UNABLE TO GET GSSAPI ERROR CODE\n");
97 plog(LLV_ERROR
, where
, NULL
,
98 "%s\n", (char *)status_string
.value
);
99 gss_release_buffer(&min_stat
, &status_string
);
101 } while (message_context
!= 0);
105 * vmbufs and gss_buffer_descs are really just the same on NetBSD, but
106 * this is to be portable.
109 gssapi_vm2gssbuf(vchar_t
*vmbuf
, gss_buffer_t gsstoken
)
112 gsstoken
->value
= racoon_malloc(vmbuf
->l
);
113 if (gsstoken
->value
== NULL
)
115 memcpy(gsstoken
->value
, vmbuf
->v
, vmbuf
->l
);
116 gsstoken
->length
= vmbuf
->l
;
122 gssapi_gss2vmbuf(gss_buffer_t gsstoken
, vchar_t
**vmbuf
)
125 *vmbuf
= vmalloc(gsstoken
->length
);
128 memcpy((*vmbuf
)->v
, gsstoken
->value
, gsstoken
->length
);
129 (*vmbuf
)->l
= gsstoken
->length
;
135 gssapi_get_default_gss_id(void)
137 char name
[NI_MAXHOST
];
140 if (gethostname(name
, sizeof(name
)) != 0) {
141 plog(LLV_ERROR
, LOCATION
, NULL
, "gethostname failed: %s\n",
145 name
[sizeof(name
) - 1] = '\0';
147 gssid
= racoon_malloc(sizeof(*gssid
));
148 gssid
->l
= asprintf(&gssid
->v
, "%s/%s", GSSAPI_DEF_NAME
, name
);
154 gssapi_get_default_name(struct ph1handle
*iph1
, int remote
, gss_name_t
*service
)
156 char name
[NI_MAXHOST
];
159 gss_buffer_desc name_token
;
160 OM_uint32 min_stat
, maj_stat
;
162 sa
= remote
? iph1
->remote
: iph1
->local
;
164 if (getnameinfo(sa
, sysdep_sa_len(sa
), name
, NI_MAXHOST
, NULL
, 0, 0) != 0)
167 name_token
.length
= asprintf(&buf
, "%s@%s", GSSAPI_DEF_NAME
, name
);
168 name_token
.value
= buf
;
170 maj_stat
= gss_import_name(&min_stat
, &name_token
,
171 GSS_C_NT_HOSTBASED_SERVICE
, service
);
172 if (GSS_ERROR(maj_stat
)) {
173 gssapi_error(min_stat
, LOCATION
, "import name\n");
174 maj_stat
= gss_release_buffer(&min_stat
, &name_token
);
175 if (GSS_ERROR(maj_stat
))
176 gssapi_error(min_stat
, LOCATION
, "release name_token");
179 maj_stat
= gss_release_buffer(&min_stat
, &name_token
);
180 if (GSS_ERROR(maj_stat
))
181 gssapi_error(min_stat
, LOCATION
, "release name_token");
187 gssapi_init(struct ph1handle
*iph1
)
189 struct gssapi_ph1_state
*gps
;
190 gss_buffer_desc id_token
, cred_token
;
191 gss_buffer_t cred
= &cred_token
;
192 gss_name_t princ
, canon_princ
;
193 OM_uint32 maj_stat
, min_stat
;
195 gps
= racoon_calloc(1, sizeof (struct gssapi_ph1_state
));
197 plog(LLV_ERROR
, LOCATION
, NULL
, "racoon_calloc failed\n");
200 gps
->gss_context
= GSS_C_NO_CONTEXT
;
201 gps
->gss_cred
= GSS_C_NO_CREDENTIAL
;
203 gssapi_set_state(iph1
, gps
);
205 if (iph1
->rmconf
->proposal
->gssid
!= NULL
) {
206 id_token
.length
= iph1
->rmconf
->proposal
->gssid
->l
;
207 id_token
.value
= iph1
->rmconf
->proposal
->gssid
->v
;
208 maj_stat
= gss_import_name(&min_stat
, &id_token
, GSS_C_NO_OID
,
210 if (GSS_ERROR(maj_stat
)) {
211 gssapi_error(min_stat
, LOCATION
, "import name\n");
212 gssapi_free_state(iph1
);
216 gssapi_get_default_name(iph1
, 0, &princ
);
218 maj_stat
= gss_canonicalize_name(&min_stat
, princ
, GSS_C_NO_OID
,
220 if (GSS_ERROR(maj_stat
)) {
221 gssapi_error(min_stat
, LOCATION
, "canonicalize name\n");
222 maj_stat
= gss_release_name(&min_stat
, &princ
);
223 if (GSS_ERROR(maj_stat
))
224 gssapi_error(min_stat
, LOCATION
, "release princ\n");
225 gssapi_free_state(iph1
);
228 maj_stat
= gss_release_name(&min_stat
, &princ
);
229 if (GSS_ERROR(maj_stat
))
230 gssapi_error(min_stat
, LOCATION
, "release princ\n");
232 maj_stat
= gss_export_name(&min_stat
, canon_princ
, cred
);
233 if (GSS_ERROR(maj_stat
)) {
234 gssapi_error(min_stat
, LOCATION
, "export name\n");
235 maj_stat
= gss_release_name(&min_stat
, &canon_princ
);
236 if (GSS_ERROR(maj_stat
))
237 gssapi_error(min_stat
, LOCATION
,
238 "release canon_princ\n");
239 gssapi_free_state(iph1
);
245 * XXXJRT Did this debug message ever work? This is a GSS name
246 * blob at this point.
248 plog(LLV_DEBUG
, LOCATION
, NULL
, "will try to acquire '%.*s' creds\n",
249 cred
->length
, cred
->value
);
252 maj_stat
= gss_release_buffer(&min_stat
, cred
);
253 if (GSS_ERROR(maj_stat
))
254 gssapi_error(min_stat
, LOCATION
, "release cred buffer\n");
256 maj_stat
= gss_acquire_cred(&min_stat
, canon_princ
, GSS_C_INDEFINITE
,
257 GSS_C_NO_OID_SET
, GSS_C_BOTH
, &gps
->gss_cred
, NULL
, NULL
);
258 if (GSS_ERROR(maj_stat
)) {
259 gssapi_error(min_stat
, LOCATION
, "acquire cred\n");
260 maj_stat
= gss_release_name(&min_stat
, &canon_princ
);
261 if (GSS_ERROR(maj_stat
))
262 gssapi_error(min_stat
, LOCATION
,
263 "release canon_princ\n");
264 gssapi_free_state(iph1
);
267 maj_stat
= gss_release_name(&min_stat
, &canon_princ
);
268 if (GSS_ERROR(maj_stat
))
269 gssapi_error(min_stat
, LOCATION
, "release canon_princ\n");
275 gssapi_get_itoken(struct ph1handle
*iph1
, int *lenp
)
277 struct gssapi_ph1_state
*gps
;
278 gss_buffer_desc empty
, name_token
;
279 gss_buffer_t itoken
, rtoken
, dummy
;
280 OM_uint32 maj_stat
, min_stat
;
283 if (gssapi_get_state(iph1
) == NULL
&& gssapi_init(iph1
) < 0)
286 gps
= gssapi_get_state(iph1
);
292 if (iph1
->approval
!= NULL
&& iph1
->approval
->gssid
!= NULL
) {
293 plog(LLV_DEBUG
, LOCATION
, NULL
,
294 "using provided service '%.*s'\n",
295 (int)iph1
->approval
->gssid
->l
, iph1
->approval
->gssid
->v
);
296 name_token
.length
= iph1
->approval
->gssid
->l
;
297 name_token
.value
= iph1
->approval
->gssid
->v
;
298 maj_stat
= gss_import_name(&min_stat
, &name_token
,
299 GSS_C_NO_OID
, &partner
);
300 if (GSS_ERROR(maj_stat
)) {
301 gssapi_error(min_stat
, LOCATION
, "import of %.*s\n",
302 name_token
.length
, name_token
.value
);
306 if (gssapi_get_default_name(iph1
, 1, &partner
) < 0)
309 rtoken
= gps
->gsscnt_p
== 0 ? dummy
: &gps
->gss_p
[gps
->gsscnt_p
- 1];
310 itoken
= &gps
->gss
[gps
->gsscnt
];
312 gps
->gss_status
= gss_init_sec_context(&min_stat
, gps
->gss_cred
,
313 &gps
->gss_context
, partner
, GSS_C_NO_OID
,
314 GSS_C_MUTUAL_FLAG
| GSS_C_SEQUENCE_FLAG
|
315 GSS_C_CONF_FLAG
| GSS_C_INTEG_FLAG
,
316 0, GSS_C_NO_CHANNEL_BINDINGS
, rtoken
, NULL
,
319 if (GSS_ERROR(gps
->gss_status
)) {
320 gssapi_error(min_stat
, LOCATION
, "init_sec_context\n");
321 maj_stat
= gss_release_name(&min_stat
, &partner
);
322 if (GSS_ERROR(maj_stat
))
323 gssapi_error(min_stat
, LOCATION
, "release name\n");
326 maj_stat
= gss_release_name(&min_stat
, &partner
);
327 if (GSS_ERROR(maj_stat
))
328 gssapi_error(min_stat
, LOCATION
, "release name\n");
330 plog(LLV_DEBUG
, LOCATION
, NULL
, "gss_init_sec_context status %x\n",
334 *lenp
= itoken
->length
;
336 if (itoken
->length
!= 0)
343 * Call gss_accept_context, with token just read from the wire.
346 gssapi_get_rtoken(struct ph1handle
*iph1
, int *lenp
)
348 struct gssapi_ph1_state
*gps
;
349 gss_buffer_desc name_token
;
350 gss_buffer_t itoken
, rtoken
;
351 OM_uint32 min_stat
, maj_stat
;
352 gss_name_t client_name
;
354 if (gssapi_get_state(iph1
) == NULL
&& gssapi_init(iph1
) < 0)
357 gps
= gssapi_get_state(iph1
);
359 rtoken
= &gps
->gss_p
[gps
->gsscnt_p
- 1];
360 itoken
= &gps
->gss
[gps
->gsscnt
];
362 gps
->gss_status
= gss_accept_sec_context(&min_stat
, &gps
->gss_context
,
363 gps
->gss_cred
, rtoken
, GSS_C_NO_CHANNEL_BINDINGS
, &client_name
,
364 NULL
, itoken
, NULL
, NULL
, NULL
);
366 if (GSS_ERROR(gps
->gss_status
)) {
367 gssapi_error(min_stat
, LOCATION
, "accept_sec_context\n");
371 maj_stat
= gss_display_name(&min_stat
, client_name
, &name_token
, NULL
);
372 if (GSS_ERROR(maj_stat
)) {
373 gssapi_error(min_stat
, LOCATION
, "gss_display_name\n");
374 maj_stat
= gss_release_name(&min_stat
, &client_name
);
375 if (GSS_ERROR(maj_stat
))
376 gssapi_error(min_stat
, LOCATION
,
377 "release client_name\n");
380 maj_stat
= gss_release_name(&min_stat
, &client_name
);
381 if (GSS_ERROR(maj_stat
))
382 gssapi_error(min_stat
, LOCATION
, "release client_name\n");
384 plog(LLV_DEBUG
, LOCATION
, NULL
,
385 "gss_accept_sec_context: other side is %s\n",
386 (char *)name_token
.value
);
387 maj_stat
= gss_release_buffer(&min_stat
, &name_token
);
388 if (GSS_ERROR(maj_stat
))
389 gssapi_error(min_stat
, LOCATION
, "release name buffer\n");
391 if (itoken
->length
!= 0)
395 *lenp
= itoken
->length
;
401 gssapi_save_received_token(struct ph1handle
*iph1
, vchar_t
*token
)
403 struct gssapi_ph1_state
*gps
;
404 gss_buffer_t gsstoken
;
407 if (gssapi_get_state(iph1
) == NULL
&& gssapi_init(iph1
) < 0)
410 gps
= gssapi_get_state(iph1
);
412 gsstoken
= &gps
->gss_p
[gps
->gsscnt_p
];
414 ret
= gssapi_vm2gssbuf(token
, gsstoken
);
423 gssapi_get_token_to_send(struct ph1handle
*iph1
, vchar_t
**token
)
425 struct gssapi_ph1_state
*gps
;
426 gss_buffer_t gsstoken
;
429 gps
= gssapi_get_state(iph1
);
431 plog(LLV_ERROR
, LOCATION
, NULL
,
432 "gssapi not yet initialized?\n");
435 gsstoken
= &gps
->gss
[gps
->gsscnt
- 1];
436 ret
= gssapi_gss2vmbuf(gsstoken
, token
);
444 gssapi_get_itokens(struct ph1handle
*iph1
, vchar_t
**tokens
)
446 struct gssapi_ph1_state
*gps
;
451 gps
= gssapi_get_state(iph1
);
453 plog(LLV_ERROR
, LOCATION
, NULL
,
454 "gssapi not yet initialized?\n");
458 for (i
= len
= 0; i
< gps
->gsscnt
; i
++)
459 len
+= gps
->gss
[i
].length
;
465 for (i
= 0; i
< gps
->gsscnt
; i
++) {
466 memcpy(p
, gps
->gss
[i
].value
, gps
->gss
[i
].length
);
467 p
+= gps
->gss
[i
].length
;
472 plog(LLV_DEBUG
, LOCATION
, NULL
,
473 "%d itokens of length %zu\n", gps
->gsscnt
, (*tokens
)->l
);
479 gssapi_get_rtokens(struct ph1handle
*iph1
, vchar_t
**tokens
)
481 struct gssapi_ph1_state
*gps
;
486 gps
= gssapi_get_state(iph1
);
488 plog(LLV_ERROR
, LOCATION
, NULL
,
489 "gssapi not yet initialized?\n");
493 if (gssapi_more_tokens(iph1
)) {
494 plog(LLV_ERROR
, LOCATION
, NULL
,
495 "gssapi roundtrips not complete\n");
499 for (i
= len
= 0; i
< gps
->gsscnt_p
; i
++)
500 len
+= gps
->gss_p
[i
].length
;
506 for (i
= 0; i
< gps
->gsscnt_p
; i
++) {
507 memcpy(p
, gps
->gss_p
[i
].value
, gps
->gss_p
[i
].length
);
508 p
+= gps
->gss_p
[i
].length
;
517 gssapi_wraphash(struct ph1handle
*iph1
)
519 struct gssapi_ph1_state
*gps
;
520 OM_uint32 maj_stat
, min_stat
;
521 gss_buffer_desc hash_in_buf
, hash_out_buf
;
522 gss_buffer_t hash_in
= &hash_in_buf
, hash_out
= &hash_out_buf
;
525 gps
= gssapi_get_state(iph1
);
527 plog(LLV_ERROR
, LOCATION
, NULL
,
528 "gssapi not yet initialized?\n");
532 if (gssapi_more_tokens(iph1
)) {
533 plog(LLV_ERROR
, LOCATION
, NULL
,
534 "gssapi roundtrips not complete\n");
538 if (gssapi_vm2gssbuf(iph1
->hash
, hash_in
) < 0) {
539 plog(LLV_ERROR
, LOCATION
, NULL
, "vm2gssbuf failed\n");
543 maj_stat
= gss_wrap(&min_stat
, gps
->gss_context
, 1, GSS_C_QOP_DEFAULT
,
544 hash_in
, NULL
, hash_out
);
545 if (GSS_ERROR(maj_stat
)) {
546 gssapi_error(min_stat
, LOCATION
, "wrapping hash value\n");
547 maj_stat
= gss_release_buffer(&min_stat
, hash_in
);
548 if (GSS_ERROR(maj_stat
))
549 gssapi_error(min_stat
, LOCATION
,
550 "release hash_in buffer\n");
554 plog(LLV_DEBUG
, LOCATION
, NULL
, "wrapped HASH, ilen %zu olen %zu\n",
555 hash_in
->length
, hash_out
->length
);
557 maj_stat
= gss_release_buffer(&min_stat
, hash_in
);
558 if (GSS_ERROR(maj_stat
))
559 gssapi_error(min_stat
, LOCATION
, "release hash_in buffer\n");
561 if (gssapi_gss2vmbuf(hash_out
, &outbuf
) < 0) {
562 plog(LLV_ERROR
, LOCATION
, NULL
, "gss2vmbuf failed\n");
563 maj_stat
= gss_release_buffer(&min_stat
, hash_out
);
564 if (GSS_ERROR(maj_stat
))
565 gssapi_error(min_stat
, LOCATION
,
566 "release hash_out buffer\n");
569 maj_stat
= gss_release_buffer(&min_stat
, hash_out
);
570 if (GSS_ERROR(maj_stat
))
571 gssapi_error(min_stat
, LOCATION
, "release hash_out buffer\n");
577 gssapi_unwraphash(struct ph1handle
*iph1
)
579 struct gssapi_ph1_state
*gps
;
580 OM_uint32 maj_stat
, min_stat
;
581 gss_buffer_desc hashbuf
, hash_outbuf
;
582 gss_buffer_t hash_in
= &hashbuf
, hash_out
= &hash_outbuf
;
585 gps
= gssapi_get_state(iph1
);
587 plog(LLV_ERROR
, LOCATION
, NULL
,
588 "gssapi not yet initialized?\n");
593 hashbuf
.length
= ntohs(iph1
->pl_hash
->h
.len
) - sizeof(*iph1
->pl_hash
);
594 hashbuf
.value
= (char *)(iph1
->pl_hash
+ 1);
596 plog(LLV_DEBUG
, LOCATION
, NULL
, "unwrapping HASH of len %zu\n",
599 maj_stat
= gss_unwrap(&min_stat
, gps
->gss_context
, hash_in
, hash_out
,
601 if (GSS_ERROR(maj_stat
)) {
602 gssapi_error(min_stat
, LOCATION
, "unwrapping hash value\n");
606 if (gssapi_gss2vmbuf(hash_out
, &outbuf
) < 0) {
607 plog(LLV_ERROR
, LOCATION
, NULL
, "gss2vmbuf failed\n");
608 maj_stat
= gss_release_buffer(&min_stat
, hash_out
);
609 if (GSS_ERROR(maj_stat
))
610 gssapi_error(min_stat
, LOCATION
,
611 "release hash_out buffer\n");
614 maj_stat
= gss_release_buffer(&min_stat
, hash_out
);
615 if (GSS_ERROR(maj_stat
))
616 gssapi_error(min_stat
, LOCATION
, "release hash_out buffer\n");
622 gssapi_set_id_sent(struct ph1handle
*iph1
)
624 struct gssapi_ph1_state
*gps
;
626 gps
= gssapi_get_state(iph1
);
628 gps
->gss_flags
|= GSSFLAG_ID_SENT
;
632 gssapi_id_sent(struct ph1handle
*iph1
)
634 struct gssapi_ph1_state
*gps
;
636 gps
= gssapi_get_state(iph1
);
638 return (gps
->gss_flags
& GSSFLAG_ID_SENT
) != 0;
642 gssapi_set_id_rcvd(struct ph1handle
*iph1
)
644 struct gssapi_ph1_state
*gps
;
646 gps
= gssapi_get_state(iph1
);
648 gps
->gss_flags
|= GSSFLAG_ID_RCVD
;
652 gssapi_id_rcvd(struct ph1handle
*iph1
)
654 struct gssapi_ph1_state
*gps
;
656 gps
= gssapi_get_state(iph1
);
658 return (gps
->gss_flags
& GSSFLAG_ID_RCVD
) != 0;
662 gssapi_free_state(struct ph1handle
*iph1
)
664 struct gssapi_ph1_state
*gps
;
665 OM_uint32 maj_stat
, min_stat
;
667 gps
= gssapi_get_state(iph1
);
672 gssapi_set_state(iph1
, NULL
);
674 if (gps
->gss_cred
!= GSS_C_NO_CREDENTIAL
) {
675 maj_stat
= gss_release_cred(&min_stat
, &gps
->gss_cred
);
676 if (GSS_ERROR(maj_stat
))
677 gssapi_error(min_stat
, LOCATION
,
678 "releasing credentials\n");
684 gssapi_get_id(struct ph1handle
*iph1
)
686 gss_buffer_desc id_buffer
;
687 gss_buffer_t id
= &id_buffer
;
688 gss_name_t defname
, canon_name
;
689 OM_uint32 min_stat
, maj_stat
;
692 if (iph1
->rmconf
->proposal
->gssid
!= NULL
)
693 return (vdup(iph1
->rmconf
->proposal
->gssid
));
695 if (gssapi_get_default_name(iph1
, 0, &defname
) < 0)
698 maj_stat
= gss_canonicalize_name(&min_stat
, defname
, GSS_C_NO_OID
,
700 if (GSS_ERROR(maj_stat
)) {
701 gssapi_error(min_stat
, LOCATION
, "canonicalize name\n");
702 maj_stat
= gss_release_name(&min_stat
, &defname
);
703 if (GSS_ERROR(maj_stat
))
704 gssapi_error(min_stat
, LOCATION
,
705 "release default name\n");
708 maj_stat
= gss_release_name(&min_stat
, &defname
);
709 if (GSS_ERROR(maj_stat
))
710 gssapi_error(min_stat
, LOCATION
, "release default name\n");
712 maj_stat
= gss_export_name(&min_stat
, canon_name
, id
);
713 if (GSS_ERROR(maj_stat
)) {
714 gssapi_error(min_stat
, LOCATION
, "export name\n");
715 maj_stat
= gss_release_name(&min_stat
, &canon_name
);
716 if (GSS_ERROR(maj_stat
))
717 gssapi_error(min_stat
, LOCATION
,
718 "release canonical name\n");
721 maj_stat
= gss_release_name(&min_stat
, &canon_name
);
722 if (GSS_ERROR(maj_stat
))
723 gssapi_error(min_stat
, LOCATION
, "release canonical name\n");
727 * XXXJRT Did this debug message ever work? This is a GSS name
728 * blob at this point.
730 plog(LLV_DEBUG
, LOCATION
, NULL
, "will try to acquire '%.*s' creds\n",
731 id
->length
, id
->value
);
734 if (gssapi_gss2vmbuf(id
, &vmbuf
) < 0) {
735 plog(LLV_ERROR
, LOCATION
, NULL
, "gss2vmbuf failed\n");
736 maj_stat
= gss_release_buffer(&min_stat
, id
);
737 if (GSS_ERROR(maj_stat
))
738 gssapi_error(min_stat
, LOCATION
, "release id buffer\n");
741 maj_stat
= gss_release_buffer(&min_stat
, id
);
742 if (GSS_ERROR(maj_stat
))
743 gssapi_error(min_stat
, LOCATION
, "release id buffer\n");