📄 krb.3
字号:
.\" $Source: /usr/src/kerberosIV/man/RCS/krb.3,v $.\" $Author: bostic $.\" $Header: /usr/src/kerberosIV/man/RCS/krb.3,v 4.11 1994/04/19 14:16:56 bostic 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".SH NAMEkrb_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.SH SYNOPSIS.nf.nj.ft B#include <kerberosIV/des.h>#include <kerberosIV/krb.h>.PP.ft Bextern char *krb_err_txt[];.PP.ft Bint krb_mk_req(authent,service,instance,realm,checksum)KTEXT authent;char *service;char *instance;char *realm;u_long checksum;.PP.ft Bint krb_rd_req(authent,service,instance,from_addr,ad,fn)KTEXT authent;char *service;char *instance;u_long from_addr;AUTH_DAT *ad;char *fn;.PP.ft Bint krb_kntoln(ad,lname)AUTH_DAT *ad;char *lname;.PP.ft Bint krb_set_key(key,cvt)char *key;int cvt;.PP.ft Bint krb_get_cred(service,instance,realm,c)char *service;char *instance;char *realm;CREDENTIALS *c;.PP.ft Blong krb_mk_priv(in,out,in_length,schedule,key,sender,receiver)u_char *in;u_char *out;u_long in_length;des_cblock key;des_key_schedule schedule;struct sockaddr_in *sender;struct sockaddr_in *receiver;.PP.ft Blong krb_rd_priv(in,in_length,schedule,key,sender,receiver,msg_data)u_char *in;u_long in_length;Key_schedule schedule;des_cblock key;struct sockaddr_in *sender;struct sockaddr_in *receiver;MSG_DAT *msg_data;.PP.ft Blong krb_mk_safe(in,out,in_length,key,sender,receiver)u_char *in;u_char *out;u_long in_length;des_cblock key;struct sockaddr_in *sender;struct sockaddr_in *receiver;.PP.ft Blong krb_rd_safe(in,length,key,sender,receiver,msg_data)u_char *in;u_long length;des_cblock key;struct sockaddr_in *sender;struct sockaddr_in *receiver;MSG_DAT *msg_data;.PP.ft Blong krb_mk_err(out,code,string)u_char *out;long code;char *string;.PP.ft Blong krb_rd_err(in,length,code,msg_data)u_char *in;u_long length;long code;MSG_DAT *msg_data;.fi.ft R.SH DESCRIPTIONThis library supports network authentication and various relatedoperations. The library contains many routines beyond those describedin this man page, but they are not intended to be used directly.Instead, they are called by the routines that are described, theauthentication server and the login program..PP.I krb_err_txt[]contains text string descriptions of various Kerberos error codes returnedby some of the routines below..PP.I krb_mk_reqtakes a pointer to a text structure in which an authenticator is to bebuilt. It also takes the name, instance, and realm of the service to beused and an optional checksum. It is up to the application to decidehow to generate the checksum..I krb_mk_reqthen retrieves a ticket for the desired service and creates anauthenticator. The authenticator is built in.I authentand is accessibleto the calling procedure..PPIt is up to the application to get the authenticator to the servicewhere it will be read by.I krb_rd_req.Unless an attacker possesses the session key contained in the ticket, itwill be unable to modify the authenticator. Thus, the checksum can beused to verify the authenticity of the other data that will pass througha connection..PP.I krb_rd_reqtakes an authenticator of type.B KTEXT,a service name, an instance, the address of thehost originating the request, and a pointer to a structure of type.B AUTH_DATwhich is filled in with information obtained from the authenticator.It also optionally takes the name of the file in which it will find thesecret key(s) for the service.If the supplied.I instancecontains "*", then the first service key with the same service namefound in the service key file will be used, and the.I instanceargument will be filled in with the chosen instance. This means thatthe caller must provide space for such an instance name..PPIt is used to find out information about the principal when a requesthas been made to a service. It is up to the application protocol to getthe authenticator from the client to the service. The authenticator isthen passed to.I krb_rd_reqto extract the desired information..PP.I krb_rd_reqreturns zero (RD_AP_OK) upon successful authentication. If a packet wasforged, modified, or replayed, authentication will fail. If theauthentication fails, a non-zero value is returned indicating theparticular problem encountered. See.I krb.hfor the list of error codes..PPIf the last argument is the null string (""), krb_rd_req will use thefile /etc/srvtab to find its keys. If the last argument is NULL, itwill assume that the key has been set by.I krb_set_keyand will not bother looking further..PP.I krb_kntolnconverts a Kerberos name to a local name. It takes a structureof 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 isreturned and can be used by an application to change uids, directories,or other parameters. It is not an integral part of Kerberos, but isinstead provided to support the use of Kerberos in existing utilities..PP.I krb_set_keytakes as an argument a des key. It then createsa key schedule from it and saves the original key to be used as aninitialization vector.It is used to set the server's key whichmust be used to decrypt tickets..PPIf called with a non-zero second argument,.I krb_set_keywill first convert the input from a string of arbitrary length to a DESkey by encrypting it with a one-way function..PPIn most cases it should not be necessary to call.I krb_set_key.The necessary keys will usually be obtained and set inside.I krb_rd_req. krb_set_keyis provided for those applications that do not wish to place theapplication keys on disk..PP.I krb_get_credsearches 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 structurewith the ticket information..PPIf the ticket was found,.I krb_get_credreturns GC_OK.If the ticket file can't be found, can't be read, doesn't belong tothe user (other than root), isn't a regular file, or is in the wrongmode, the error GC_TKFIL is returned..PP.I krb_mk_privcreates an encrypted, authenticatedmessage from any arbitrary application data, pointed to by.I inand.I in_lengthbytes long.The private session key, pointed to by.I keyand the key schedule,.I schedule,are used to encrypt the data and some header information using.I pcbc_encrypt..I senderand.I receiverpoint to the Internet address of the two parties.In addition to providing privacy, this protocol message protectsagainst modifications, insertions or replays. The encapsulated message andheader are placed in the area pointed to by.I outand the routine returns the length of the output, or -1 indicatingan error..PP.I krb_rd_privdecrypts and authenticates a received.I krb_mk_privmessage..I inpoints to the beginning of the received message, whose lengthis specified in.I in_length.The private session key, pointed to by.I key,and the key schedule,.I schedule,are used to decrypt and verify the received message..I msg_datais a pointer to a.I MSG_DATstruct, defined in.I krb.h.The routine fills in the.I app_datafield with a pointer to the decrypted application data,.I app_lengthwith the length of the.I app_datafield,.I time_secand.I time_5mswith the timestamps in the message, and.I swapwith a 1 if the byte order of the receiver is different than that ofthe sender. (The application must still determine if it is appropriateto byte-swap application data; the Kerberos protocol fields are already takencare of). The.I hashfield returns a value useful as input to the.I krb_ck_replroutine.The routine returns zero if ok, or a Kerberos error code. Modified messagesand old messages cause errors, but it is up to the caller tocheck the time sequence of messages, and to check against recently replayedmessages using.I krb_ck_replif so desired..PP.I krb_mk_safecreates an authenticated, but unencrypted message from any arbitraryapplication data,pointed to by.I inand.I in_lengthbytes long.The private session key, pointed to by.I key,is used to seed the.I quad_cksum()checksum algorithm used as part of the authentication..I senderand.I receiverpoint 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 andheader are placed in the area pointed to by.I outand the routine returns the length of the output, or -1 indicatingan error.The authentication provided by this routine is not as strong as thatprovided by.I krb_mk_privor by computing the checksum using.I cbc_cksuminstead, both of which authenticate via DES..PP.I krb_rd_safeauthenticates a received.I krb_mk_safemessage..I inpoints to the beginning of the received message, whose lengthis specified in.I in_length.The private session key, pointed to by.I key,is used to seed the quad_cksum() routine as part of the authentication..I msg_datais a pointer to a.I MSG_DATstruct, defined in.I krb.h .The routine fills in these.I MSG_DATfields:the.I app_datafield with a pointer to the application data,.I app_lengthwith the length of the.I app_datafield,.I time_secand.I time_5mswith the timestamps in the message, and.I swapwith a 1 if the byte order of the receiver is different than that ofthe sender.(The application must still determine if it is appropriateto byte-swap application data; the Kerberos protocol fields are already takencare of). The.I hashfield returns a value useful as input to the.I krb_ck_replroutine.The routine returns zero if ok, or a Kerberos error code. Modified messagesand old messages cause errors, but it is up to the caller tocheck the time sequence of messages, and to check against recently replayedmessages using.I krb_ck_replif so desired..PP.I krb_mk_errconstructs an application level error message that may be used alongwith.I krb_mk_privor.I krb_mk_safe..I outis a pointer to the output buffer,.I codeis an application specific error code, and.I stringis an application specific error string..PP.I krb_rd_errunpacks a received.I krb_mk_errmessage..I inpoints to the beginning of the received message, whose lengthis specified in.I in_length..I codeis a pointer to a value to be filled in with the errorvalue provided by the application..I msg_datais a pointer to a.I MSG_DATstruct, defined in.I krb.h .The routine fills in these.I MSG_DATfields: the.I app_datafield with a pointer to the application error text,.I app_lengthwith the length of the.I app_datafield, and.I swapwith a 1 if the byte order of the receiver is different than that ofthe sender. (The application must still determine if it is appropriateto byte-swap application data; the Kerberos protocol fields are already takencare of).The routine returns zero if the error message has been successfully received,or a Kerberos error code..PPThe.I KTEXTstructure is used to pass around text of varying lengths. It consistsof a buffer for the data, and a length. krb_rd_req takes an argument of thistype containing the authenticator, and krb_mk_req returns theauthenticator in a structure of this type. KTEXT itself is really apointer to the structure. The actual structure is of type KTEXT_ST..PPThe.I AUTH_DATstructure is filled in by krb_rd_req. It must be allocated beforecalling krb_rd_req, and a pointer to it is passed. The structure isfilled in with data obtained from Kerberos..I MSG_DATstructure is filled in by either krb_rd_priv, krb_rd_safe, orkrb_rd_err. It must be allocated before the call and a pointer to itis passed. The structure isfilled in with data obtained from Kerberos..PP.SH FILES/usr/include/kerberosIV/krb.h.br/usr/lib/libkrb.a.br/usr/include/kerberosIV/des.h.br/usr/lib/libdes.a.br/etc/kerberosIV/aname.br/etc/kerberosIV/srvtab.br/tmp/tkt[uid].SH "SEE ALSO"kerberos(1), des_crypt(3).SH DIAGNOSTICS.SH BUGSThe caller of.I krb_rd_req, krb_rd_priv, and krb_rd_safemust check time order and for replay attempts..I krb_ck_replis not implemented yet..SH AUTHORSClifford Neuman, MIT Project Athena.brSteve Miller, MIT Project Athena/Digital Equipment Corporation.SH RESTRICTIONSCOPYRIGHT 1985,1986,1989 Massachusetts Institute of Technology
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -