FreeBSD/crypto/openssh/gss-serv.c
/* Returns a GSSAPI error code */
/* Privileged (called from ssh_gssapi_server_ctx) */
Returns a GSSAPI error code
Privileged (called from ssh_gssapi_server_ctx)
Returns a GSSAPI error code Privileged ( called from ssh_gssapi_server_ctx )
static OM_uint32
ssh_gssapi_acquire_cred(Gssctxt *ctx)
{
	OM_uint32 status;
	char lname[NI_MAXHOST];
	gss_OID_set oidset;
	if (options.gss_strict_acceptor) {
		gss_create_empty_oid_set(&status, &oidset);
		gss_add_oid_set_member(&status, ctx->oid, &oidset);
		if (gethostname(lname, MAXHOSTNAMELEN)) {
			gss_release_oid_set(&status, &oidset);
			return (-1);
		}
		if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname))) {
			gss_release_oid_set(&status, &oidset);
			return (ctx->major);
		}
		if ((ctx->major = gss_acquire_cred(&ctx->minor,
		    ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds,
		    NULL, NULL)))
			ssh_gssapi_error(ctx);
		gss_release_oid_set(&status, &oidset);
		return (ctx->major);
	} else {
		ctx->name = GSS_C_NO_NAME;
		ctx->creds = GSS_C_NO_CREDENTIAL;
	}
	return GSS_S_COMPLETE;
}
static OM_uint32 ssh_gssapi_acquire_cred ( Gssctxt * ctx ) { OM_uint32 status ; char lname [ NI_MAXHOST ] ; gss_OID_set oidset ; if ( options . gss_strict_acceptor ) { gss_create_empty_oid_set ( & status , & oidset ) ; gss_add_oid_set_member ( & status , ctx -> oid , & oidset ) ; if ( gethostname ( lname , MAXHOSTNAMELEN ) ) { gss_release_oid_set ( & status , & oidset ) ; return ( -1 ) ; } if ( GSS_ERROR ( ssh_gssapi_import_name ( ctx , lname ) ) ) { gss_release_oid_set ( & status , & oidset ) ; return ( ctx -> major ) ; } if ( ( ctx -> major = gss_acquire_cred ( & ctx -> minor , ctx -> name , 0 , oidset , GSS_C_ACCEPT , & ctx -> creds , NULL , NULL ) ) ) ssh_gssapi_error ( ctx ) ; gss_release_oid_set ( & status , & oidset ) ; return ( ctx -> major ) ; } else { ctx -> name = GSS_C_NO_NAME ; ctx -> creds = GSS_C_NO_CREDENTIAL ; } return GSS_S_COMPLETE ; }
Returns a GSSAPI error code
Privileged (called from ssh_gssapi_server_ctx)
Returns a GSSAPI error code Privileged ( called from ssh_gssapi_server_ctx )