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

# gss\_wrap(3)

API function

## NAME

gss\_wrap - API function

## SYNOPSIS

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

**OM\_uint32 gss\_wrap(OM\_uint32 \*** *minor\_status***, const gss\_ctx\_id\_t** *context\_handle***, int** *conf\_req\_flag***, gss\_qop\_t** *qop\_req***, const gss\_buffer\_t** *input\_message\_buffer***, int \*** *conf\_state***, gss\_buffer\_t** *output\_message\_buffer***);**

## ARGUMENTS

- OM\_uint32 \* minor\_status

  (Integer, modify) Mechanism specific status code.

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

  (gss\_ctx\_id\_t, read) Identifies the context on\
     which the message will be sent.

- int conf\_req\_flag

  (boolean, read) Non-zero - Both confidentiality and\
     integrity services are requested. Zero - Only integrity service is\
     requested.

- gss\_qop\_t qop\_req

  (gss\_qop\_t, read, optional) Specifies required quality of\
     protection.  A mechanism-specific default may be requested by\
     setting qop\_req to GSS\_C\_QOP\_DEFAULT.  If an unsupported\
     protection strength is requested, gss\_wrap will return a\
     major\_status of GSS\_S\_BAD\_QOP.

- const gss\_buffer\_t input\_message\_buffer

  (buffer, opaque, read) Message to be\
     protected.

- int \* conf\_state

  (boolean, modify, optional) Non-zero -\
     Confidentiality, data origin authentication and integrity\
     services have been applied. Zero - Integrity and data origin\
     services only has been applied.  Specify NULL if not required.

- gss\_buffer\_t output\_message\_buffer

  (buffer, opaque, modify) Buffer to receive\
     protected message.  Storage associated with this message must be\
     freed by the application after use with a call to\
     **gss\_release\_buffer()**.

## DESCRIPTION

Attaches a cryptographic MIC and optionally encrypts the specified input\_message.  The output\_message contains both the MIC and the message.  The qop\_req parameter allows a choice between several cryptographic algorithms, if supported by the chosen mechanism.

Since some application-level protocols may wish to use tokens emitted by **gss\_wrap()** to provide "secure framing", implementations must support the wrapping of zero-length messages.

## RETURN VALUE

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

\`GSS\_S\_CONTEXT\_EXPIRED\`: The context has already expired.

\`GSS\_S\_NO\_CONTEXT\`: The context\_handle parameter did not identify a\
  valid context.

\`GSS\_S\_BAD\_QOP\`: The specified QOP is not supported by the mechanism.

## 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.
