krb_sendauth.3krb
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3KRB 代码 · 共 698 行 · 第 1/2 页
3KRB
698 行
.TH krb_sendauth 3krb.SH Namekrb_sendauth, krb_recvauth \- Kerberos authentication library routines..SH Syntax.nf.nj \fB#include <krb.h> #include <des.h> #include <netinet/in.h>\fP.PP \fBint krb_sendauth\fP (\fIoptions, fd, tkt_authen, f_service, f_inst, f_realm, checksum, msg_data, cred, schedule, l_addr, f_addr, version_in\fP) \fBlong\fP \fIoptions\fP; \fBint\fP \fIfd\fP; \fBKTEXT\fP \fItkt_authen\fP; \fBchar\fP \fI*f_service\fP; \fBchar\fP \fI*f_instance\fP; \fBchar\fP \fI*f_realm\fP; \fBu_long\fP \fIchecksum\fP; \fBMSG_DAT\fP \fI*msg_data\fP; \fBCREDENTIALS\fP \fI*cred\fP; \fBKey_schedule\fP \fIschedule\fP; \fBstruct sockaddr_in\fP \fI*l_addr\fP; \fBstruct sockaddr_in\fP \fI*f_addr\fP; \fBchar\fP \fI*version_in\fP;.PP \fBint krb_recvauth\fP (\fIoptions, fd, tkt_authen_out, l_service, l_instance, f_addr, l_addr, ad, srvtab_file, schedule, version_out\fP) \fBlong\fP \fIoptions\fP; \fBint\fP \fIfd\fP; \fBKTEXT\fP \fItkt_authen_out\fP; \fBchar\fP \fI*l_service\fP; \fBchar\fP \fI*l_instance\fP; \fBstruct sockaddr_in\fP \fI*f_addr\fP; \fBstruct sockaddr_in\fP \fI*l_addr\fP; \fBAUTH_DAT\fP \fI*ad\fP; \fBchar\fP \fI*srvtab_file\fP; \fBKey_schedule\fP \fIschedule\fP; \fBchar\fP \fI*version_out\fP; .ig ++.PP \fBint krb_net_write\fP \fI(fd, buf, len)\fP \fBint\fP \fIfd;\fP \fBchar\fP \fI*buf;\fP \fBint\fP \fIlen;\fP.PP \fBint krb_net_read\fP \fI(fd, buf, len)\fP \fBint\fP \fIfd;\fP \fBchar\fP \fI*buf;\fP \fBint\fP \fIlen;\fP.++.PP.fi.SH Arguments.TP 8.I optionsDefined in .PN /usr/include/krb.h .To specify multiple options, construct the \fIoptions\fP argument asa bitwise-OR of the desired options.The options are as follows:.br.ne 4.RS.TP 9KOPT_DONT_MK_REQ.PN krb_sendauthwill not use the .PN krb_mk_reqfunction (see.PN kerberos(3krb) )to produce the ticket-authenticator pair, \fIauthen_tkt\fP.Instead, the ticket-authenticator pair is read from the argument,\fItkt_authen\fP..TP 9.sp 2KOPT_DONT_CANON.PN krb_sendauthwill not convert the instance name, \fIf_instance\fP, to canonical form.If KOPT_DONT_CANON is not set, the instance name used is the output from.PN krb_get_phost(see.PN krb_get_lrealm(3krb) )with argument \fIf_instance\fP as input..TP 9KOPT_DO_MUTUAL.PN krb_sendauthand.PN krb_recvauthprovide authentication on both ends of the network connection.Otherwise, the caller of.PN krb_sendauthis authenticated to the caller of.PN krb_recvauth ,but the caller of .PN krb_recvauthis not authenticated to the caller of.PN krb_sendauth .For mutual authentication to occur, both.PN krb_sendauthand.PN krb_recvauthmust be called with this option set..RE.TP.I f_service Character pointer to the primary name of the foreignprincipal. The local principal is the principal that callsthe above routines. The foreign principal is theprincipal with which the local principal is attempting tocommunicate. If KOPT_DONT_MK_REQ is set and KOPT_DO_MUTUALis not, then \fIf_service\fP should be set equal to the NULL pointer..TP.I f_instanceCharacter pointer to the instance name of the foreignprincipal. If KOPT_DONT_MK_REQ is set and KOPT_DO_MUTUALis not, then \fIf_instance\fP should be set equal to the NULL pointer..TP.I f_realmCharacter pointer to the realm name of the foreign principal.If the \fIf_realm\fP parameter is set equal to the NULL pointer,then the local realm is used as the \fIf_realm\fP. IfKOPT_DONT_MK_REQ is set and KOPT_DO_MUTUAL is not,then \fIf_service\fP should be set equal to the NULL pointer..TP.I l_serviceCharacter pointer to the primary name of the localprincipal..TP.I l_instanceCharacter pointer to the instance name of the localprincipal. .TP.I fdThe file descriptor used to send data to the foreignprincipal, or the file descriptor from which data fromthe foreign principal can be read. In either case, thefile descriptor must be associated with a socket that usesblocking I/O..TP.I tkt_authenPointer to the text structure in which the Kerberoslibrary routines build the ticket-authenticator pair. Thisstructure is designed to be included within the .PN krb_sendauthmessage sent to the foreign principalto authenticate the local principal's identity to theforeign principal. This structure can be either input to.PN krb_sendauthor output from .PN krb_sendauthdepending on whetherKOPT_DONT_MK_REQ is set or not set. In either case, storagemust be allocated for \fItkt_authen\fP..TP.I tkt_authen_outPointer to the ticket-authenticator pair that.PN krb_recvauthreads from within the .PN krb_sendauth message. The .PN krb_sendauthmessage is sent by .PN krb_sendauthto the local principal to authenticate the foreignprincipal to the local principal. Storage must be allocated for\fItkt_authen_out\fP..TP.I checksumInput to .PN krb_sendauth ;\fIchecksum\fP is packaged in the.PN krb_sendauthmessage that is sent to the foreign principal.It serves as a secret piece of data that can only be known tothe foreign principal if the foreign principal isauthenticated as the foreign principal. It is used tofacilitate mutual authentication, so if the KOPT_DO_MUTUAL isnot set, the value of this argument is inconsequential. Ifboth KOPT_DONT_MK_REQ and KOPT_DO_MUTUAL are set, then the \fIchecksum\fP parameter must be equal to the checksum valueused by.PN krb_mk_reqin the creation of the ticket-authenticator pair, \fIauthen_tkt\fP..TP.I msg_dataPointer to a structure which is filled withthe mutual authentication message sent by .PN krb_recvauthandinterpreted by .PN krb_sendauth .The message sent from .PN krb_sendauthto .PN krb_recvauth ,the message that includes the ticket-authenticator pair,authenticates only the caller of .PN krb_sendauthto the caller of .PN krb_recvauth .An additionalmessage, the one returned by .PN krb_sendauthinside \fImsg_data\fP,must be sent by .PN krb_recvauthand interpreted by .PN krb_sendauthin order to authenticate the caller of .PN krb_recvauthto thecaller of .PN krb_sendauth .If the KOPT_DO_MUTUAL option is set,space must be allocated for the \fImsg_data\fP structure. Otherwise,since no message will be sent from .PN krb_recvauthto .PN krb_sendauth ,the \fImsg_data\fP parameter should be set equivalent to the NULLpointer..TP.I creda pointer to a credentials structure that is outputfrom .PN krb_sendauth .The credentials structure includes the ticket that the local principal uses toauthenticate to the foreign principal as well as other authenticationinformation associated with the foreign principal.If the KOPT_DO_MUTUAL option isset, space must be allocated for the \fIcred\fP structure andthe \fIcred\fP structure will be filled in by .PN krb_sendauth .Otherwise, the \fIcred\fP structure will not be filled in by.PN krb_sendauth ,so the \fIcred\fP parameter should be set equivalentto the NULL pointer..TP.I schedulea key schedule, derived from the session keybetween the local and foreign principals, that is output from.PN krb_sendauthand .PN krb_recvauth .If the KOPT_DO_MUTUAL option isset, the key schedule will be filled in; otherwise, thekey schedule will not be filled. In anycase, space must be allocated for the key schedule..TP.I f_addrthe address of the socket that the foreignprincipal is using to communicate with the local principal.If the KOPT_DO_MUTUAL option is not set on a call to .PN krb_sendauth ,then the \fIf_addr\fP parameter should be set equivalent to the NULLpointer. \fIf_addr\fP should never be set to NULL on a call to.PN krb_recvauth ..TP.I l_addrthe address of the socket that the local principalis using to communicate with the foreign principal. Ifthe KOPT_DO_MUTUAL option is not set, the \fIl_addr\fP parametershould be set equivalent to the NULL pointer..TP.I ada pointer to the AUTH_DAT structure that describes the authenticationassociation between the local and foreign principals. Since it is output from.PN krb_recvauth ,space for the \fIad\fP structure must be allocated..TP.I srvtab_filepath name of the file that contains thekey of the principal obtaining a ticket.If this value is set equal to a string of zero length, .PN srvtab_file[0] ='\\\\0',the default service table file (srvtab) value is used. Ifthis value is set equal to the NULL pointer, then the key of the serviceis not read from the srvtab file, but is read from storage spaceinternal to the libraries. The \fIsrvtab_file\fP parameter cannot be setto the NULL string on the first call to.PN krb_sendauth .The default srvtab file value is set to.PN /etc/srvtabalthough this value can be changed bya call to the .PN krb_set_srvtab_stringfunction (see.PN krb_set_tkt_string(3krb) )..TP.I version_inAn application-specific version string input to .PN krb_sendauth .This argument allows the caller of .PN krb_sendauthto pass anapplication-specific version string, within the .PN krb_sendauthmessage format, that the caller of .PN krb_recvauthcan use to matchagainst its own version string. The version string canbe up to KRB_SENDAUTH_VLEN characters long and, in addition,it can be set equal to the NULL string..TP.I version_outAn application-specific version string output from .PN krb_recvauth .This argument allows the caller of .PN krb_recvauthto receivethe application-specific version string included in the .PN krb_sendauthmessage that was sent by the foreign principal.The version string can be up to KRB_SENDAUTH_VLEN characterslong..SH Description.NXR "Kerberos routines" "krb_sendauth".NXR "Kerberos routines" "krb_recvauth"The .PN krb_sendauth(3krb)routines are designed to be used by applications thatcommunicate over a network, require the authentication of bothparties across the communications path, and which support "on-the-wire"protocols that have no room for authentication information. The.PN krb_sendauth(3krb)routines are designed to perform only the authentication ofthe first message sent between such applications. Therefore, the.PN krb_sendauth(3krb)routines should be used before any other communication occursbetween the authenticating principals. .PPAfter the communicationschannel between the applications has been established, but before anycommunication takes place, and before the "on-the-wire" protocol of theapplication comes into effect,.PN krb_sendauthcreatesa message which can authenticate the caller of .PN krb_sendauth ,"A", to thecaller of .PN krb_recvauth ,"B"..PN krb_sendauth
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?