---
name: "krb5_free_kdc_rep"
section: "3"
platform: "linux"
package: "heimdal-dev"
version: "7.8.git20221117.28daf24+dfsg-9+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/krb5_free_kdc_rep"
---

# krb5\_free\_kdc\_rep(3)

deprecated initial authentication functions

## NAME

**krb5\_get\_in\_tkt**, **krb5\_get\_in\_cred**, **krb5\_get\_in\_tkt\_with\_password**, **krb5\_get\_in\_tkt\_with\_keytab**, **krb5\_get\_in\_tkt\_with\_skey**, **krb5\_free\_kdc\_rep**, **krb5\_password\_key\_proc** – deprecated initial authentication functions

## LIBRARY

Kerberos 5 Library (libkrb5, -lkrb5)

## SYNOPSIS

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

*krb5\_error\_code*\

**krb5\_get\_in\_tkt**(*krb5\_context context*, *krb5\_flags options*, *const krb5\_addresses \*addrs*, *const krb5\_enctype \*etypes*, *const krb5\_preauthtype \*ptypes*, *krb5\_key\_proc key\_proc*, *krb5\_const\_pointer keyseed*, *krb5\_decrypt\_proc decrypt\_proc*, *krb5\_const\_pointer decryptarg*, *krb5\_creds \*creds*, *krb5\_ccache ccache*, *krb5\_kdc\_rep \*ret\_as\_reply*);

*krb5\_error\_code*\

**krb5\_get\_in\_cred**(*krb5\_context context*, *krb5\_flags options*, *const krb5\_addresses \*addrs*, *const krb5\_enctype \*etypes*, *const krb5\_preauthtype \*ptypes*, *const krb5\_preauthdata \*preauth*, *krb5\_key\_proc key\_proc*, *krb5\_const\_pointer keyseed*, *krb5\_decrypt\_proc decrypt\_proc*, *krb5\_const\_pointer decryptarg*, *krb5\_creds \*creds*, *krb5\_kdc\_rep \*ret\_as\_reply*);

*krb5\_error\_code*\

**krb5\_get\_in\_tkt\_with\_password**(*krb5\_context context*, *krb5\_flags options*, *krb5\_addresses \*addrs*, *const krb5\_enctype \*etypes*, *const krb5\_preauthtype \*pre\_auth\_types*, *const char \*password*, *krb5\_ccache ccache*, *krb5\_creds \*creds*, *krb5\_kdc\_rep \*ret\_as\_reply*);

*krb5\_error\_code*\

**krb5\_get\_in\_tkt\_with\_keytab**(*krb5\_context context*, *krb5\_flags options*, *krb5\_addresses \*addrs*, *const krb5\_enctype \*etypes*, *const krb5\_preauthtype \*pre\_auth\_types*, *krb5\_keytab keytab*, *krb5\_ccache ccache*, *krb5\_creds \*creds*, *krb5\_kdc\_rep \*ret\_as\_reply*);

*krb5\_error\_code*\

**krb5\_get\_in\_tkt\_with\_skey**(*krb5\_context context*, *krb5\_flags options*, *krb5\_addresses \*addrs*, *const krb5\_enctype \*etypes*, *const krb5\_preauthtype \*pre\_auth\_types*, *const krb5\_keyblock \*key*, *krb5\_ccache ccache*, *krb5\_creds \*creds*, *krb5\_kdc\_rep \*ret\_as\_reply*);

*krb5\_error\_code*\

**krb5\_free\_kdc\_rep**(*krb5\_context context*, *krb5\_kdc\_rep \*rep*);

*krb5\_error\_code*\

**krb5\_password\_key\_proc**(*krb5\_context context*, *krb5\_enctype type*, *krb5\_salt salt*, *krb5\_const\_pointer keyseed*, *krb5\_keyblock \*\*key*);

## DESCRIPTION

All the functions in this manual page are deprecated in the MIT implementation, and will soon be deprecated in Heimdal too, don't use them.

Getting initial credential ticket for a principal. **krb5\_get\_in\_cred** is the function all other krb5\_get\_in function uses to fetch tickets. The other krb5\_get\_in function are more specialized and therefor somewhat easier to use.

If your need is only to verify a user and password, consider using [krb5\_verify\_user(3)](/krb5_verify_user/3.md) instead, it have a much simpler interface.

**krb5\_get\_in\_tkt** and **krb5\_get\_in\_cred** fetches initial credential, queries after key using the *key\_proc* argument. The differences between the two function is that **krb5\_get\_in\_tkt** stores the credential in a krb5\_creds while **krb5\_get\_in\_cred** stores the credential in a krb5\_ccache.

**krb5\_get\_in\_tkt\_with\_password**, **krb5\_get\_in\_tkt\_with\_keytab**, and **krb5\_get\_in\_tkt\_with\_skey** does the same work as **krb5\_get\_in\_cred** but are more specialized.

**krb5\_get\_in\_tkt\_with\_password** uses the clients password to authenticate. If the password argument is NULL the user user queried with the default password query function.

**krb5\_get\_in\_tkt\_with\_keytab** searches the given keytab for a service entry for the client principal. If the keytab is NULL the default keytab is used.

**krb5\_get\_in\_tkt\_with\_skey** uses a key to get the initial credential.

There are some common arguments to the krb5\_get\_in functions, these are:

*options* are the KDC\_OPT flags.

*etypes* is a NULL terminated array of encryption types that the client approves.

*addrs* a list of the addresses that the initial ticket. If it is NULL the list will be generated by the library.

*pre\_auth\_types* a NULL terminated array of pre-authentication types. If *pre\_auth\_types* is NULL the function will try without pre-authentication and return those pre-authentication that the KDC returned.

*ret\_as\_reply* will (if not NULL) be filled in with the response of the KDC and should be free with **krb5\_free\_kdc\_rep**().

*key\_proc* is a pointer to a function that should return a key salted appropriately. Using NULL will use the default password query function.

*decrypt\_proc* Using NULL will use the default decryption function.

*decryptarg* will be passed to the decryption function *decrypt\_proc*.

*creds* creds should be filled in with the template for a credential that should be requested. The client and server elements of the creds structure must be filled in. Upon return of the function it will be contain the content of the requested credential *(*, *krb5\_get\_in\_cred*), or it will be freed with [krb5\_free\_creds(3)](/krb5_free_creds/3.md) (all the other krb5\_get\_in functions).

*ccache* will store the credential in the credential cache *ccache*. The credential cache will not be initialized, thats up the the caller.

**krb5\_password\_key\_proc** is a library function that is suitable using as the *krb5\_key\_proc* argument to **krb5\_get\_in\_cred** or **krb5\_get\_in\_tkt**. *keyseed* should be a pointer to a NUL terminated string or NULL. **krb5\_password\_key\_proc** will query the user for the pass on the console if the password isn't given as the argument *keyseed*.

**krb5\_free\_kdc\_rep**() frees the content of *rep*.

## SEE ALSO

[krb5(3)](/krb5/3.md), [krb5\_verify\_user(3)](/krb5_verify_user/3.md), [krb5.conf(5)](/krb5.conf/5.md), [kerberos(8)](/kerberos/8.md)
