1*0a6a1f1dSLionel Sambuc.\" $NetBSD: krb5_mk_req.3,v 1.1.1.3 2014/04/24 12:45:50 pettai Exp $ 2ebfedea0SLionel Sambuc.\" 3ebfedea0SLionel Sambuc.\" Copyright (c) 2005 Kungliga Tekniska Högskolan 4ebfedea0SLionel Sambuc.\" (Royal Institute of Technology, Stockholm, Sweden). 5ebfedea0SLionel Sambuc.\" All rights reserved. 6ebfedea0SLionel Sambuc.\" 7ebfedea0SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 8ebfedea0SLionel Sambuc.\" modification, are permitted provided that the following conditions 9ebfedea0SLionel Sambuc.\" are met: 10ebfedea0SLionel Sambuc.\" 11ebfedea0SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 12ebfedea0SLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 13ebfedea0SLionel Sambuc.\" 14ebfedea0SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 15ebfedea0SLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 16ebfedea0SLionel Sambuc.\" documentation and/or other materials provided with the distribution. 17ebfedea0SLionel Sambuc.\" 18ebfedea0SLionel Sambuc.\" 3. Neither the name of the Institute nor the names of its contributors 19ebfedea0SLionel Sambuc.\" may be used to endorse or promote products derived from this software 20ebfedea0SLionel Sambuc.\" without specific prior written permission. 21ebfedea0SLionel Sambuc.\" 22ebfedea0SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 23ebfedea0SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24ebfedea0SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25ebfedea0SLionel Sambuc.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 26ebfedea0SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27ebfedea0SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28ebfedea0SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29ebfedea0SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30ebfedea0SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31ebfedea0SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32ebfedea0SLionel Sambuc.\" SUCH DAMAGE. 33ebfedea0SLionel Sambuc.\" 34ebfedea0SLionel Sambuc.\" Id 35ebfedea0SLionel Sambuc.\" 36ebfedea0SLionel Sambuc.Dd August 27, 2005 37ebfedea0SLionel Sambuc.Dt KRB5_MK_REQ 3 38ebfedea0SLionel Sambuc.Os 39ebfedea0SLionel Sambuc.Sh NAME 40ebfedea0SLionel Sambuc.Nm krb5_mk_req , 41ebfedea0SLionel Sambuc.Nm krb5_mk_req_exact , 42ebfedea0SLionel Sambuc.Nm krb5_mk_req_extended , 43ebfedea0SLionel Sambuc.Nm krb5_rd_req , 44ebfedea0SLionel Sambuc.Nm krb5_rd_req_with_keyblock , 45ebfedea0SLionel Sambuc.Nm krb5_mk_rep , 46ebfedea0SLionel Sambuc.Nm krb5_mk_rep_exact , 47ebfedea0SLionel Sambuc.Nm krb5_mk_rep_extended , 48ebfedea0SLionel Sambuc.Nm krb5_rd_rep , 49ebfedea0SLionel Sambuc.Nm krb5_build_ap_req , 50ebfedea0SLionel Sambuc.Nm krb5_verify_ap_req 51ebfedea0SLionel Sambuc.Nd create and read application authentication request 52ebfedea0SLionel Sambuc.Sh LIBRARY 53ebfedea0SLionel SambucKerberos 5 Library (libkrb5, -lkrb5) 54ebfedea0SLionel Sambuc.Sh SYNOPSIS 55ebfedea0SLionel Sambuc.In krb5/krb5.h 56ebfedea0SLionel Sambuc.Ft krb5_error_code 57ebfedea0SLionel Sambuc.Fo krb5_mk_req 58ebfedea0SLionel Sambuc.Fa "krb5_context context" 59ebfedea0SLionel Sambuc.Fa "krb5_auth_context *auth_context" 60ebfedea0SLionel Sambuc.Fa "const krb5_flags ap_req_options" 61ebfedea0SLionel Sambuc.Fa "const char *service" 62ebfedea0SLionel Sambuc.Fa "const char *hostname" 63ebfedea0SLionel Sambuc.Fa "krb5_data *in_data" 64ebfedea0SLionel Sambuc.Fa "krb5_ccache ccache" 65ebfedea0SLionel Sambuc.Fa "krb5_data *outbuf" 66ebfedea0SLionel Sambuc.Fc 67ebfedea0SLionel Sambuc.Ft krb5_error_code 68ebfedea0SLionel Sambuc.Fo krb5_mk_req_extended 69ebfedea0SLionel Sambuc.Fa "krb5_context context" 70ebfedea0SLionel Sambuc.Fa "krb5_auth_context *auth_context" 71ebfedea0SLionel Sambuc.Fa "const krb5_flags ap_req_options" 72ebfedea0SLionel Sambuc.Fa "krb5_data *in_data" 73ebfedea0SLionel Sambuc.Fa "krb5_creds *in_creds" 74ebfedea0SLionel Sambuc.Fa "krb5_data *outbuf" 75ebfedea0SLionel Sambuc.Fc 76ebfedea0SLionel Sambuc.Ft krb5_error_code 77ebfedea0SLionel Sambuc.Fo krb5_rd_req 78ebfedea0SLionel Sambuc.Fa "krb5_context context" 79ebfedea0SLionel Sambuc.Fa "krb5_auth_context *auth_context" 80ebfedea0SLionel Sambuc.Fa "const krb5_data *inbuf" 81ebfedea0SLionel Sambuc.Fa "krb5_const_principal server" 82ebfedea0SLionel Sambuc.Fa "krb5_keytab keytab" 83ebfedea0SLionel Sambuc.Fa "krb5_flags *ap_req_options" 84ebfedea0SLionel Sambuc.Fa "krb5_ticket **ticket" 85ebfedea0SLionel Sambuc.Fc 86ebfedea0SLionel Sambuc.Ft krb5_error_code 87ebfedea0SLionel Sambuc.Fo krb5_build_ap_req 88ebfedea0SLionel Sambuc.Fa "krb5_context context" 89ebfedea0SLionel Sambuc.Fa "krb5_enctype enctype" 90ebfedea0SLionel Sambuc.Fa "krb5_creds *cred" 91ebfedea0SLionel Sambuc.Fa "krb5_flags ap_options" 92ebfedea0SLionel Sambuc.Fa "krb5_data authenticator" 93ebfedea0SLionel Sambuc.Fa "krb5_data *retdata" 94ebfedea0SLionel Sambuc.Fc 95ebfedea0SLionel Sambuc.Ft krb5_error_code 96ebfedea0SLionel Sambuc.Fo krb5_verify_ap_req 97ebfedea0SLionel Sambuc.Fa "krb5_context context" 98ebfedea0SLionel Sambuc.Fa "krb5_auth_context *auth_context" 99ebfedea0SLionel Sambuc.Fa "krb5_ap_req *ap_req" 100ebfedea0SLionel Sambuc.Fa "krb5_const_principal server" 101ebfedea0SLionel Sambuc.Fa "krb5_keyblock *keyblock" 102ebfedea0SLionel Sambuc.Fa "krb5_flags flags" 103ebfedea0SLionel Sambuc.Fa "krb5_flags *ap_req_options" 104ebfedea0SLionel Sambuc.Fa "krb5_ticket **ticket" 105ebfedea0SLionel Sambuc.Fc 106ebfedea0SLionel Sambuc.Sh DESCRIPTION 107ebfedea0SLionel SambucThe functions documented in this manual page document the functions 108ebfedea0SLionel Sambucthat facilitates the exchange between a Kerberos client and server. 109ebfedea0SLionel SambucThey are the core functions used in the authentication exchange 110ebfedea0SLionel Sambucbetween the client and the server. 111ebfedea0SLionel Sambuc.Pp 112ebfedea0SLionel SambucThe 113ebfedea0SLionel Sambuc.Nm krb5_mk_req 114ebfedea0SLionel Sambucand 115ebfedea0SLionel Sambuc.Nm krb5_mk_req_extended 116ebfedea0SLionel Sambuccreates the Kerberos message 117ebfedea0SLionel Sambuc.Dv KRB_AP_REQ 118ebfedea0SLionel Sambucthat is sent from the client to the server as the first packet in a client/server exchange. The result that should be sent to server is stored in 119ebfedea0SLionel Sambuc.Fa outbuf . 120ebfedea0SLionel Sambuc.Pp 121ebfedea0SLionel Sambuc.Fa auth_context 122ebfedea0SLionel Sambucshould be allocated with 123ebfedea0SLionel Sambuc.Fn krb5_auth_con_init 124ebfedea0SLionel Sambucor 125ebfedea0SLionel Sambuc.Dv NULL 126ebfedea0SLionel Sambucpassed in, in that case, it will be allocated and freed internally. 127ebfedea0SLionel Sambuc.Pp 128ebfedea0SLionel SambucThe input data 129ebfedea0SLionel Sambuc.Fa in_data 130ebfedea0SLionel Sambucwill have a checksum calculated over it and checksum will be 131ebfedea0SLionel Sambuctransported in the message to the server. 132ebfedea0SLionel Sambuc.Pp 133ebfedea0SLionel Sambuc.Fa ap_req_options 134ebfedea0SLionel Sambuccan be set to one or more of the following flags: 135ebfedea0SLionel Sambuc.Pp 136ebfedea0SLionel Sambuc.Bl -tag -width indent 137ebfedea0SLionel Sambuc.It Dv AP_OPTS_USE_SESSION_KEY 138ebfedea0SLionel SambucUse the session key when creating the request, used for user to user 139ebfedea0SLionel Sambucauthentication. 140ebfedea0SLionel Sambuc.It Dv AP_OPTS_MUTUAL_REQUIRED 141ebfedea0SLionel SambucMark the request as mutual authenticate required so that the receiver 142ebfedea0SLionel Sambucreturns a mutual authentication packet. 143ebfedea0SLionel Sambuc.El 144ebfedea0SLionel Sambuc.Pp 145ebfedea0SLionel SambucThe 146ebfedea0SLionel Sambuc.Nm krb5_rd_req 147ebfedea0SLionel Sambucread the AP_REQ in 148ebfedea0SLionel Sambuc.Fa inbuf 149ebfedea0SLionel Sambucand verify and extract the content. 150ebfedea0SLionel SambucIf 151ebfedea0SLionel Sambuc.Fa server 152ebfedea0SLionel Sambucis specified, that server will be fetched from the 153ebfedea0SLionel Sambuc.Fa keytab 154ebfedea0SLionel Sambucand used unconditionally. 155ebfedea0SLionel SambucIf 156ebfedea0SLionel Sambuc.Fa server 157ebfedea0SLionel Sambucis 158ebfedea0SLionel Sambuc.Dv NULL , 159ebfedea0SLionel Sambucthe 160ebfedea0SLionel Sambuc.Fa keytab 161ebfedea0SLionel Sambucwill be search for a matching principal. 162ebfedea0SLionel Sambuc.Pp 163ebfedea0SLionel SambucThe 164ebfedea0SLionel Sambuc.Fa keytab 165ebfedea0SLionel Sambucargument specifies what keytab to search for receiving principals. 166ebfedea0SLionel SambucThe arguments 167ebfedea0SLionel Sambuc.Fa ap_req_options 168ebfedea0SLionel Sambucand 169ebfedea0SLionel Sambuc.Fa ticket 170ebfedea0SLionel Sambucreturns the content. 171ebfedea0SLionel Sambuc.Pp 172ebfedea0SLionel SambucWhen the AS-REQ is a user to user request, neither of 173ebfedea0SLionel Sambuc.Fa keytab 174ebfedea0SLionel Sambucor 175ebfedea0SLionel Sambuc.Fa principal 176ebfedea0SLionel Sambucare used, instead 177ebfedea0SLionel Sambuc.Fn krb5_rd_req 178ebfedea0SLionel Sambucexpects the session key to be set in 179ebfedea0SLionel Sambuc.Fa auth_context . 180ebfedea0SLionel Sambuc.Pp 181ebfedea0SLionel SambucThe 182ebfedea0SLionel Sambuc.Nm krb5_verify_ap_req 183ebfedea0SLionel Sambucand 184ebfedea0SLionel Sambuc.Nm krb5_build_ap_req 185ebfedea0SLionel Sambucboth constructs and verify the AP_REQ message, should not be used by 186ebfedea0SLionel Sambucexternal code. 187ebfedea0SLionel Sambuc.Sh SEE ALSO 188ebfedea0SLionel Sambuc.Xr krb5 3 , 189ebfedea0SLionel Sambuc.Xr krb5.conf 5 190