.\" $Source: /usr/src/kerberosIV/man/RCS/kerberos.3,v $
.\" $Header: /usr/src/kerberosIV/man/RCS/kerberos.3,v 4.10 90/06/25 21:12:11 kfall Exp $
.\" Copyright 1989 by the Massachusetts Institute of Technology.
.\" For copying and distribution information,
.\" please see the file <mit-copyright.h>.
.TH KERBEROS 3 "Kerberos Version 4.0" "MIT Project Athena"
krb_mk_req, krb_rd_req, krb_kntoln, krb_set_key, krb_get_cred,
krb_mk_priv, krb_rd_priv, krb_mk_safe, krb_rd_safe, krb_mk_err,
krb_rd_err, krb_ck_repl \- Kerberos authentication library
#include <kerberosIV/des.h>
#include <kerberosIV/krb.h>
extern char *krb_err_txt[];
int krb_mk_req(authent,service,instance,realm,checksum)
int krb_rd_req(authent,service,instance,from_addr,ad,fn)
int krb_get_cred(service,instance,realm,c)
long krb_mk_priv(in,out,in_length,schedule,key,sender,receiver)
des_key_schedule schedule;
struct sockaddr_in *sender;
struct sockaddr_in *receiver;
long krb_rd_priv(in,in_length,schedule,key,sender,receiver,msg_data)
struct sockaddr_in *sender;
struct sockaddr_in *receiver;
long krb_mk_safe(in,out,in_length,key,sender,receiver)
struct sockaddr_in *sender;
struct sockaddr_in *receiver;
long krb_rd_safe(in,length,key,sender,receiver,msg_data)
struct sockaddr_in *sender;
struct sockaddr_in *receiver;
long krb_mk_err(out,code,string)
long krb_rd_err(in,length,code,msg_data)
This library supports network authentication and various related
operations. The library contains many routines beyond those described
in this man page, but they are not intended to be used directly.
Instead, they are called by the routines that are described, the
authentication server and the login program.
contains text string descriptions of various Kerberos error codes returned
by some of the routines below.
takes a pointer to a text structure in which an authenticator is to be
built. It also takes the name, instance, and realm of the service to be
used and an optional checksum. It is up to the application to decide
how to generate the checksum.
then retrieves a ticket for the desired service and creates an
authenticator. The authenticator is built in
to the calling procedure.
It is up to the application to get the authenticator to the service
Unless an attacker posesses the session key contained in the ticket, it
will be unable to modify the authenticator. Thus, the checksum can be
used to verify the authenticity of the other data that will pass through
takes an authenticator of type
a service name, an instance, the address of the
host originating the request, and a pointer to a structure of type
which is filled in with information obtained from the authenticator.
It also optionally takes the name of the file in which it will find the
secret key(s) for the service.
contains "*", then the first service key with the same service name
found in the service key file will be used, and the
argument will be filled in with the chosen instance. This means that
the caller must provide space for such an instance name.
It is used to find out information about the principal when a request
has been made to a service. It is up to the application protocol to get
the authenticator from the client to the service. The authenticator is
to extract the desired information.
returns zero (RD_AP_OK) upon successful authentication. If a packet was
forged, modified, or replayed, authentication will fail. If the
authentication fails, a non-zero value is returned indicating the
particular problem encountered. See
for the list of error codes.
If the last argument is the null string (""), krb_rd_req will use the
file /etc/srvtab to find its keys. If the last argument is NULL, it
will assume that the key has been set by
and will not bother looking further.
converts a Kerberos name to a local name. It takes a structure
of type AUTH_DAT and uses the name and instance to look in the database
/etc/aname to find the corresponding local name. The local name is
returned and can be used by an application to change uids, directories,
or other parameters. It is not an integral part of Kerberos, but is
instead provided to support the use of Kerberos in existing utilities.
takes as an argument a des key. It then creates
a key schedule from it and saves the original key to be used as an
It is used to set the server's key which
must be used to decrypt tickets.
If called with a non-zero second argument,
will first convert the input from a string of arbitrary length to a DES
key by encrypting it with a one-way function.
In most cases it should not be necessary to call
The necessary keys will usually be obtained and set inside
.I krb_rd_req. krb_set_key
is provided for those applications that do not wish to place the
application keys on disk.
searches the caller's ticket file for a ticket for the given service, instance,
and realm; and, if a ticket is found, fills in the given CREDENTIALS structure
with the ticket information.
If the ticket file can't be found, can't be read, doesn't belong to
the user (other than root), isn't a regular file, or is in the wrong
mode, the error GC_TKFIL is returned.
creates an encrypted, authenticated
message from any arbitrary application data, pointed to by
The private session key, pointed to by
are used to encrypt the data and some header information using
point to the Internet address of the two parties.
In addition to providing privacy, this protocol message protects
against modifications, insertions or replays. The encapsulated message and
header are placed in the area pointed to by
and the routine returns the length of the output, or -1 indicating
decrypts and authenticates a received
points to the beginning of the received message, whose length
The private session key, pointed to by
are used to decrypt and verify the received message.
field with a pointer to the decrypted application data,
with the timestamps in the message, and
with a 1 if the byte order of the receiver is different than that of
the sender. (The application must still determine if it is appropriate
to byte-swap application data; the Kerberos protocol fields are already taken
field returns a value useful as input to the
The routine returns zero if ok, or a Kerberos error code. Modified messages
and old messages cause errors, but it is up to the caller to
check the time sequence of messages, and to check against recently replayed
creates an authenticated, but unencrypted message from any arbitrary
The private session key, pointed to by
checksum algorithm used as part of the authentication.
point to the Internet address of the two parties.
This message does not provide privacy, but does protect (via detection)
against modifications, insertions or replays. The encapsulated message and
header are placed in the area pointed to by
and the routine returns the length of the output, or -1 indicating
The authentication provided by this routine is not as strong as that
or by computing the checksum using
instead, both of which authenticate via DES.
points to the beginning of the received message, whose length
The private session key, pointed to by
is used to seed the quad_cksum() routine as part of the authentication.
The routine fills in these
field with a pointer to the application data,
with the timestamps in the message, and
with a 1 if the byte order of the receiver is different than that of
(The application must still determine if it is appropriate
to byte-swap application data; the Kerberos protocol fields are already taken
field returns a value useful as input to the
The routine returns zero if ok, or a Kerberos error code. Modified messages
and old messages cause errors, but it is up to the caller to
check the time sequence of messages, and to check against recently replayed
constructs an application level error message that may be used along
is a pointer to the output buffer,
is an application specific error code, and
is an application specific error string.
points to the beginning of the received message, whose length
is a pointer to a value to be filled in with the error
value provided by the application.
The routine fills in these
field with a pointer to the application error text,
with a 1 if the byte order of the receiver is different than that of
the sender. (The application must still determine if it is appropriate
to byte-swap application data; the Kerberos protocol fields are already taken
The routine returns zero if the error message has been successfully received,
or a Kerberos error code.
structure is used to pass around text of varying lengths. It consists
of a buffer for the data, and a length. krb_rd_req takes an argument of this
type containing the authenticator, and krb_mk_req returns the
authenticator in a structure of this type. KTEXT itself is really a
pointer to the structure. The actual structure is of type KTEXT_ST.
structure is filled in by krb_rd_req. It must be allocated before
calling krb_rd_req, and a pointer to it is passed. The structure is
filled in with data obtained from Kerberos.
structure is filled in by either krb_rd_priv, krb_rd_safe, or
krb_rd_err. It must be allocated before the call and a pointer to it
is passed. The structure is
filled in with data obtained from Kerberos.
/usr/include/kerberosIV/krb.h
/usr/include/kerberosIV/des.h
kerberos(1), des_crypt(3)
.I krb_rd_req, krb_rd_priv, and krb_rd_safe
must check time order and for replay attempts.
Clifford Neuman, MIT Project Athena
Steve Miller, MIT Project Athena/Digital Equipment Corporation
COPYRIGHT 1985,1986,1989 Massachusetts Institute of Technology