Print this page
6817447 libgss and various mechs are hiding both the real minor_status and the error token
6405422 Solaris acceptors fail in AD-KDC environments when using non-"host" services (e.g. "cifs")
6824434 Unable to accept context establishment initiated by Windows 2000 clients
6787343 kclient's site lookups fail in certain network environments
6692646 kclient should output errors to stderr
6525327 kinit failed when arcfour-hmac-md5-exp was used for the principal's key
6745582 SUNWkdcu missing package dependencies after kclientv2 integration
   1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License, Version 1.0 only
   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */

  22 /*
  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 #pragma ident   "%Z%%M% %I%     %E% SMI"
  28 
  29 /*
  30  *  glue routine for gss_accept_sec_context
  31  */
  32 
  33 #include <mechglueP.h>
  34 #ifdef HAVE_STDLIB_H
  35 #include <stdlib.h>
  36 #endif
  37 #include <string.h>
  38 #include <errno.h>
  39 
  40 OM_uint32
  41 gss_accept_sec_context(minor_status,
  42                         context_handle,
  43                         verifier_cred_handle,
  44                         input_token_buffer,
  45                         input_chan_bindings,
  46                         src_name,
  47                         mech_type,
  48                         output_token,


 312                 if (src_name == NULL && tmp_src_name != NULL)
 313                         (void) gss_release_name(&t_minstat,
 314                                         &tmp_src_name);
 315                 return  (status);
 316         } else {
 317 
 318                 status = GSS_S_BAD_MECH;
 319         }
 320 
 321 error_out:
 322         if (union_ctx_id) {
 323                 if (union_ctx_id->mech_type) {
 324                         if (union_ctx_id->mech_type->elements)
 325                                 free(union_ctx_id->mech_type->elements);
 326                         free(union_ctx_id->mech_type);
 327                 }
 328                 free(union_ctx_id);
 329                 *context_handle = GSS_C_NO_CONTEXT;
 330         }
 331 
 332         if (output_token->length)
 333                 (void) gss_release_buffer(&t_minstat, output_token);
 334 
 335         if (src_name)
 336                 *src_name = GSS_C_NO_NAME;
 337 
 338         if (tmp_src_name != GSS_C_NO_NAME)
 339                 (void) gss_release_buffer(&t_minstat,
 340                         (gss_buffer_t)tmp_src_name);
 341 
 342         return (status);
 343 }
   1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.

   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 
  22 /*
  23  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 


  27 /*
  28  *  glue routine for gss_accept_sec_context
  29  */
  30 
  31 #include <mechglueP.h>
  32 #ifdef HAVE_STDLIB_H
  33 #include <stdlib.h>
  34 #endif
  35 #include <string.h>
  36 #include <errno.h>
  37 
  38 OM_uint32
  39 gss_accept_sec_context(minor_status,
  40                         context_handle,
  41                         verifier_cred_handle,
  42                         input_token_buffer,
  43                         input_chan_bindings,
  44                         src_name,
  45                         mech_type,
  46                         output_token,


 310                 if (src_name == NULL && tmp_src_name != NULL)
 311                         (void) gss_release_name(&t_minstat,
 312                                         &tmp_src_name);
 313                 return  (status);
 314         } else {
 315 
 316                 status = GSS_S_BAD_MECH;
 317         }
 318 
 319 error_out:
 320         if (union_ctx_id) {
 321                 if (union_ctx_id->mech_type) {
 322                         if (union_ctx_id->mech_type->elements)
 323                                 free(union_ctx_id->mech_type->elements);
 324                         free(union_ctx_id->mech_type);
 325                 }
 326                 free(union_ctx_id);
 327                 *context_handle = GSS_C_NO_CONTEXT;
 328         }
 329 



 330         if (src_name)
 331                 *src_name = GSS_C_NO_NAME;
 332 
 333         if (tmp_src_name != GSS_C_NO_NAME)
 334                 (void) gss_release_buffer(&t_minstat,
 335                         (gss_buffer_t)tmp_src_name);
 336 
 337         return (status);
 338 }