---
name: "gss_inquire_context"
section: "3"
platform: "linux"
package: "gss-man"
version: "1.0.4-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gss_inquire_context"
---

# gss\_inquire\_context(3)

API function

## NAME

gss\_inquire\_context - API function

## SYNOPSIS

**#include \<gss.h\>**

**OM\_uint32 gss\_inquire\_context(OM\_uint32 \*** *minor\_status***, const gss\_ctx\_id\_t** *context\_handle***, gss\_name\_t \*** *src\_name***, gss\_name\_t \*** *targ\_name***, OM\_uint32 \*** *lifetime\_rec***, gss\_OID \*** *mech\_type***, OM\_uint32 \*** *ctx\_flags***, int \*** *locally\_initiated***, int \*** *open***);**

## ARGUMENTS

- OM\_uint32 \* minor\_status

  (Integer, modify) Mechanism specific status code.

- const gss\_ctx\_id\_t context\_handle

  (gss\_ctx\_id\_t, read) A handle that refers to the\
     security context.

- gss\_name\_t \* src\_name

  (gss\_name\_t, modify, optional) The name of the context\
     initiator.  If the context was established using anonymous\
     authentication, and if the application invoking\
     gss\_inquire\_context is the context acceptor, an anonymous name\
     will be returned.  Storage associated with this name must be\
     freed by the application after use with a call to\
     **gss\_release\_name()**.  Specify NULL if not required.

- gss\_name\_t \* targ\_name

  (gss\_name\_t, modify, optional) The name of the context\
     acceptor.  Storage associated with this name must be freed by the\
     application after use with a call to **gss\_release\_name()**.  If the\
     context acceptor did not authenticate itself, and if the\
     initiator did not specify a target name in its call to\
     **gss\_init\_sec\_context()**, the value GSS\_C\_NO\_NAME will be returned.\
     Specify NULL if not required.

- OM\_uint32 \* lifetime\_rec

  (Integer, modify, optional) The number of seconds\
     for which the context will remain valid.  If the context has\
     expired, this parameter will be set to zero.  If the\
     implementation does not support context expiration, the value\
     GSS\_C\_INDEFINITE will be returned.  Specify NULL if not required.

- gss\_OID \* mech\_type

  (gss\_OID, modify, optional) The security mechanism\
     providing the context.  The returned OID will be a pointer to\
     static storage that should be treated as read-only by the\
     application; in particular the application should not attempt to\
     free it.  Specify NULL if not required.

- OM\_uint32 \* ctx\_flags

  (bit-mask, modify, optional) Contains various\
     independent flags, each of which indicates that the context\
     supports (or is expected to support, if ctx\_open is false) a\
     specific service option.  If not needed, specify NULL.  Symbolic\
     names are provided for each flag, and the symbolic names\
     corresponding to the required flags should be logically-ANDed\
     with the ret\_flags value to test whether a given option is\
     supported by the context.  See below for the flags.

- int \* locally\_initiated

  (Boolean, modify) Non-zero if the invoking\
     application is the context initiator.  Specify NULL if not\
     required.

- int \* open

  (Boolean, modify) Non-zero if the context is fully\
     established; Zero if a context-establishment token is expected\
     from the peer application.  Specify NULL if not required.

## DESCRIPTION

Obtains information about a security context.  The caller must already have obtained a handle that refers to the context, although the context need not be fully established.

The \`ctx\_flags\` values:

\`GSS\_C\_DELEG\_FLAG\`:: - True - Credentials were delegated from the initiator to the acceptor. - False - No credentials were delegated.

\`GSS\_C\_MUTUAL\_FLAG\`:: - True - The acceptor was authenticated to the initiator. - False - The acceptor did not authenticate itself.

\`GSS\_C\_REPLAY\_FLAG\`:: - True - replay of protected messages will be detected. - False - replayed messages will not be detected.

\`GSS\_C\_SEQUENCE\_FLAG\`:: - True - out-of-sequence protected messages will be detected. - False - out-of-sequence messages will not be detected.

\`GSS\_C\_CONF\_FLAG\`:: - True - Confidentiality service may be invoked by calling gss\_wrap routine. - False - No confidentiality service (via gss\_wrap) available. gss\_wrap will provide message encapsulation, data-origin authentication and integrity services only.

\`GSS\_C\_INTEG\_FLAG\`:: - True - Integrity service may be invoked by calling either gss\_get\_mic or gss\_wrap routines. - False - Per-message integrity service unavailable.

\`GSS\_C\_ANON\_FLAG\`:: - True - The initiator's identity will not be revealed to the acceptor.  The src\_name parameter (if requested) contains an anonymous internal name. - False - The initiator has been authenticated normally.

\`GSS\_C\_PROT\_READY\_FLAG\`:: - True - Protection services (as specified by the states of the GSS\_C\_CONF\_FLAG and GSS\_C\_INTEG\_FLAG) are available for use. - False - Protection services (as specified by the states of the GSS\_C\_CONF\_FLAG and GSS\_C\_INTEG\_FLAG) are available only if the context is fully established (i.e. if the open parameter is non-zero).

\`GSS\_C\_TRANS\_FLAG\`:: - True - The resultant security context may be transferred to other processes via a call to **gss\_export\_sec\_context()**. - False - The security context is not transferable.

## RETURN VALUE

\`GSS\_S\_COMPLETE\`: Successful completion.

\`GSS\_S\_NO\_CONTEXT\`: The referenced context could not be accessed.

## REPORTING BUGS

Report bugs to \<bug-gss@gnu.org\>. GNU Generic Security Service home page: http://www.gnu.org/software/gss/ General help using GNU software: http://www.gnu.org/gethelp/

## COPYRIGHT

Copyright © 2003-2022 Simon Josefsson.\
 Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

## SEE ALSO

The full documentation for **gss** is maintained as a Texinfo manual.  If the **info** and **gss** programs are properly installed at your site, the command

-

  **info gss**

should give you access to the complete manual.
