krb_sendauth.3krb

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3KRB 代码 · 共 698 行 · 第 1/2 页

3KRB
698
字号
then sends the message to"B" where it is read from the communications channel by .PN krb_recvauth ..PPNext,.PN krb_recvauthattempts to authenticate "A" by producing a responseto "A" which, depending upon the value of KOPT_DO_MUTUAL and thesuccess of the authentication of "A" by .PN krb_recvauth , will containeither an error code, a code indicating	success, or a mutualauthentication message..PN krb_recvauthsends the response and returns to "B".  .PN krb_sendauthreceives themessage from "B", tries to authenticate "B" if KOPT_DO_MUTUAL is set, andthen returns to "A".  .PPSince the authentication information is sentbetween the applications before the "on-the-wire" protocol of the application comes into effect, the application must develop somemethod of distinguishing between the new authenticated initial messageexchange and an old unauthenticated initial message exchange..PPThe.PN krb_sendauth(3krb)routines make extensiveuse of the locally defined data types KTEXT, MSG_DAT,CREDENTIALS, and Key_schedule.  For specific information onthe definitions of these data types, see the \f(CWdes.h\fP and\f(CWkrb.h\fP files..PPThe routines found in the .PN krb_sendauth(3krb) library are.PN krb_sendauthand.PN krb_recvauth :.IP krb_sendauth.PPThe .PN krb_sendauthfunction is designed to authenticate alocal principal, "A", to the principal specified by the\fIf_service\fP, \fIf_instance\fP, and \fIf_realm\fP parameters, "B",and to allowthe authentication of "B" to "A" as well.  .PN krb_sendauthuses file descriptor \fIfd\fP, to send the authenticationmessage that will authenticate "A" to principal "B".It returns, in the \fItkt_authen\fP parameter, theticket-authenticator pair used to authenticate "A" to "B".  The\fIversion_in\fP parameter contains an application-specific versionstring which is transmitted to "B" along with the authenticationmessage..PP		If mutual authentication is selected as an option, the filedescriptor, \fIfd\fP will be used to receive a mutual authenticationmessage from "B".To allow the mutual authentication to take place, \fIl_addr\fP and\fIf_addr\fP must be set equal to the address of the sockets whichthe local and foreign principals use to communicate.A value known only to "A" must be input to .PN krb_sendauthas the \fIchecksum\fP parameter.  As the resultof mutual authentication, \fIcred\fP will be filled with datadescribing the authentication information associated with "B", \fIschedule\fP will be set equal to the key_schedule of thesession key between "A" and "B", and \fImsg_data\fP will be set equalto the mutual authentication message sent from "B" to "A". .PP\fIfd\fP must be a file descriptor associated with ablocking socket.  Otherwise, .PN krb_sendauthwill not functioncorrectly..PPIf "A" has been correctly authenticated to "B" and mutualauthentication was not chosen as an option, or if "A" has beencorrectly authenticated to "B", and "B" correctly authenticatedto "A" and mutual authentication was chosen as an option, then KSUCCESS is returned by.PN krb_sendauth ..PPThe following is a list of most of the error values from.PN krb_sendauth .Since .PN krb_sendauthcalls other section 3 Kerberos routines (.PN 3krb ) to perform its function, some of the error codesare references to the error codes of other functions:.TP 18SENDAUTH_OPNOTSUPThe \fIoptions\fP bits sent to .PN krb_sendauthcontain a bitwhich is set, but does not correspond to an option..TP 18SENDAUTH_WR.PN krb_sendauthcould not write the authentication messageto "B" using \fIfd\fP..TP 18KFAILUREThe.PN /etc/krb.conffile cannot be opened, or.brThe .PN /etc/krb.conffile (see.PN krb.conf(5krb) )is not formed properly, or.brAn authentication message was sent from "A" to "B", but"B" could not successfully identify "A", or.brA mutual authentication message was sent from "B" to"A", but "A" could not successfully identify "B"..TP 18-1Negative one is returned if each byte of thesession key does not have odd parity..TP 18-2Negative two is returned if the session key is a weakkey as defined by .PN des_is_weak_key(see .PN des_crypt(3krb) )..TP 18NO_TKT_FIL The ticket file does not exist..TP 18TKT_FIL_ACCThe ticket file cannot be opened or the ticket filecannot be accessed..TP 18TKT_FIL_LCKThe ticket file could not be locked for access..TP 18TKT_FIL_FMTThe ticket file format is incorrect..TP 18AD_NOTGTThere is no ticket-granting-ticket in the ticketfile that can be used to ask for a ticket to communicatewith the foreign principal..TP 18SKDC_CANTA Kerberos server must be contacted in orderfor.PN krb_sendauthto perform its function, butthe attempt cannot be made because a socketcannot be opened or bound, or there is no Kerberosserver listed in.PN /etc/krb.conf ..TP 18SKDC_RETRYA Kerberos server needs to be contacted, butnone responded even after several retries..TP 18INTK_PROTKerberos protocol error..TP 18GC_NOTKTInformation concerning the foreign principal does notexist in the ticket file..TP 18RECVMUT_OPNOTSUPThe \fIoptions\fP bits sent to .PN krb_recvmutual(see.PN krb_sendmutual(3krb) )contain a bitwhich is set, but does not correspond to an option..TP 18RECVMUT_RDIf the message cannot be read from the file descriptor\fIfd\fP, SENDMUT_RD is returned..TP 18RD_AP_VERSIONIf the Kerberos version used to create the mutualauthentication message is not supported by.PN krb_recvmutual ,then RD_AP_VERSION is returned..TP 18RD_AP_MSG_TYPEIf the message read from the file descriptor, \fIfd\fP,is not a mutual authentication message,RD_AP_MSG_TYPE is returned..TP 18RD_AP_MODIFIEDIf the mutual authentication message has been modifiedbetween the "B" and "A" or it was in some way incorrectly produced, RD_AP_MODIFIED is returned..TP 18RD_AP_TIMEReturned if the mutual authentication message is too old..IP krb_recvauth.PPThe .PN krb_recvauth function is designed to wait for a messagefrom .PN krb_sendauthon the file descriptor \fIfd\fP, receive the message and attempt to authenticate the foreign principal, "A",to the local principal determined by the \fIl_service\fP and\fIl_instance\fP parameters.  The \fIsrvtab_file\fP must contain theprivate key of principal "B".  The \fItkt_authen_out\fP parameteris filled with the ticket-authenticator pair sent within the.PN krb_sendauthmessage received by "B" from "A".  \fIad\fP is filled withinformation that describes the authentication associationbetween "A" and "B".  \fIversion_out\fP is filled with the applicationversion string included in the .PN krb_sendauthmessage..PPIf mutual authentication is selected as an option, the filedescriptor \fIfd\fP, will be used to send a mutual authenticationmessage to "A".  To allow the mutual authentication to takeplace, \fIl_addr\fP and \fIf_addr\fP must be set equal to the address ofthe sockets that the local and foreign principals are usingto communicate.  As the result of mutual authentication,\fIschedule\fP will be set equal to the key_schedule of thesession key between "A" and "B"..PP\fIfd\fP must be a file descriptor that is associated with ablocking socket.  Otherwise, .PN krb_recvauth will not functioncorrectly..PPIf "A" has been correctly authenticated to "B" and mutualauthentication was not chosen as an option, or if mutual authentication is an option and "A" has beencorrectly authenticated to "B" and "B" has sent a mutual authentication message to "B", then KSUCCESS is returnedby .PN krb_recvauth ..PPThe following is a list of most of the error values from.PN krb_recvauth.  Since .PN krb_recvauthcalls other section 3 Kerberos routines (.PN 3krb )to perform its function, some of the error codesare references to the error codes of other functions..TP 18RECVAUTH_OPNOTSUPThe \fIoptions\fP bits sent to .PN krb_recvauthcontain a bitwhich is set but does not correspond to an option..TP 18RECVAUTH_RD.PN krb_recvauthcould not read the authentication messagesent to "B" using \fIfd\fP..TP 18RECVAUTH_TKTLENThe length of the ticket-authenticator pair withinthe .PN krb_sendauthmessage is longer than the maximumor less than or equal to 0..TP 18RD_AP_VERSIONThe versions of Kerberos used by the caller of .PN krb_sendauthis incompatible with the .PN krb_recvauthversion..TP 18RD_AP_MSG_TYPEThe ticket-authenticator pair given to .PN krb_recvauthwas not really a ticket-authenticator pair..TP 18RD_AP_UNDECThe ticket could not be decyphered.  This error can becaused by a forged or modified message..TP 18RD_AP_INCONThe message given to .PN krb_recvauthcontains an internalinconsistency.  This could occur if the ticketin the ticket-authenticator pair does not matchthe authenticator..TP 18RD_AP_BADDThe ticket-authenticator pair cannot be used to authenticate a principal from the address specified by\fIf_addr\fP. .TP 18RD_AP_TIMEThe authenticator in the ticket-authenticator pairis too old to be used to authenticate the foreignprincipal..TP 18RD_AP_NYVThe time at which the ticket of the ticket-authenticatorpair was created is too far ahead of the time of thelocal host of the local principal..TP 18RD_AP_EXPThe ticket is too old to be used..TP 18-1Negative one is returned if the each byte of thesession key does not have odd parity..TP 18-2Negative two is returned if the session key is a weakkey as defined by .PN des_is_weak_key ..TP 18SENDMUT_OPNOTSUPThe options bits sent to .PN krb_sendmutualcontains a bitwhich is set but does not correspond to an option..TP 18SENDMUT_MAKMSGIf there is an error in forming the mutualauthentication message itself, SENDMUT_MAKMSG isreturned..TP 18SENDMUT_WRIf the mutual authentication message cannot bewritten to the file descriptor \fIfd\fP, SENDMUT_WR isreturned..SH Restrictions.PN krb_sendauthand.PN krb_recvauthwill not work properly on sockets set to nonblocking I/O mode..SH See Alsokerberos(3krb), krb_sendmutual(3krb), krb_svc_init(3krb), des_crypt(3krb,krb_get_lrealm(3krb), krb_set_tkt_string(3krb), krb.conf(5krb).

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?