File: misc.go

package info (click to toggle)
gitlab-shell 14.35.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,652 kB
  • sloc: ruby: 1,129; makefile: 583; sql: 391; sh: 384
file content (45 lines) | stat: -rw-r--r-- 868 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2013-2015 Apcera Inc. All rights reserved.

package gssapi

/*
#include <gssapi/gssapi.h>
#include <stdlib.h>

OM_uint32
wrap_gss_indicate_mechs(void *fp,
	OM_uint32 *minor_status,
	gss_OID_set * mech_set)
{
	gss_OID_set_desc *ms = NULL;
	OM_uint32 maj;
	maj = ((OM_uint32(*)(
		OM_uint32 *,
		gss_OID_set *))fp) (
			minor_status,
			mech_set);

	return maj;
}

*/
import "C"

// IndicateMechs implements the gss_Indicate_mechs call, according to https://tools.ietf.org/html/rfc2743#page-69.
// This returns an OIDSet of the Mechs supported on the current OS.
func (lib *Lib) IndicateMechs() (*OIDSet, error) {

	mechs := lib.NewOIDSet()

	var min C.OM_uint32
	maj := C.wrap_gss_indicate_mechs(
		lib.Fp_gss_indicate_mechs,
		&min,
		&mechs.C_gss_OID_set)
	err := lib.stashLastStatus(maj, min)
	if err != nil {
		return nil, err
	}

	return mechs, nil
}