---
name: "sasl_decode"
section: "3"
platform: "macos"
package: "passwordserver_sasl"
version: "215"
release: "macOS 26.5"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/sasl_decode"
---

# sasl\_decode(3)

Decode data received

## NAME

sasl\_decode - Decode data received

## SYNOPSIS

```
#include <sasl/sasl.h>

int sasl_decode(sasl_conn_t *conn,
		     const char * input,
                unsigned inputlen,
		     const char ** output,
		     unsigned * outputlen);
```

## DESCRIPTION

**sasl\_decode** decodes data received. After successful authentication this function should be called on all data received. It decodes the data from encrypted or signed form to plain data. If there was no security layer negotiated the output is identical to the input.

*output* contains the decoded data and is allocated/freed by the library.

One should not to give sasl\_decode more data than the negotiated maxbufsize (see sasl\_getprop).

Note that sasl\_decode can succeed and outputlen can be zero. If this is the case simply wait for more data and call sasl\_decode again.

## RETURN VALUE

Returns SASL\_OK on success. See [sasl\_errors(3)](/sasl_errors/3.md) for meanings of other return codes.

## CONFORMING TO

RFC 4422

## SEE ALSO

[sasl(3)](/sasl/3.md), [sasl\_errors(3)](/sasl_errors/3.md), [sasl\_encode(3)](/sasl_encode/3.md)
