1*ebfedea0SLionel Sambuc.\" $NetBSD: kadm5_pwcheck.3,v 1.1.1.2 2011/04/14 14:09:17 elric Exp $ 2*ebfedea0SLionel Sambuc.\" 3*ebfedea0SLionel Sambuc.\" Copyright (c) 2003 - 2004 Kungliga Tekniska Högskolan 4*ebfedea0SLionel Sambuc.\" (Royal Institute of Technology, Stockholm, Sweden). 5*ebfedea0SLionel Sambuc.\" All rights reserved. 6*ebfedea0SLionel Sambuc.\" 7*ebfedea0SLionel Sambuc.\" Redistribution and use in source and binary forms, with or without 8*ebfedea0SLionel Sambuc.\" modification, are permitted provided that the following conditions 9*ebfedea0SLionel Sambuc.\" are met: 10*ebfedea0SLionel Sambuc.\" 11*ebfedea0SLionel Sambuc.\" 1. Redistributions of source code must retain the above copyright 12*ebfedea0SLionel Sambuc.\" notice, this list of conditions and the following disclaimer. 13*ebfedea0SLionel Sambuc.\" 14*ebfedea0SLionel Sambuc.\" 2. Redistributions in binary form must reproduce the above copyright 15*ebfedea0SLionel Sambuc.\" notice, this list of conditions and the following disclaimer in the 16*ebfedea0SLionel Sambuc.\" documentation and/or other materials provided with the distribution. 17*ebfedea0SLionel Sambuc.\" 18*ebfedea0SLionel Sambuc.\" 3. Neither the name of the Institute nor the names of its contributors 19*ebfedea0SLionel Sambuc.\" may be used to endorse or promote products derived from this software 20*ebfedea0SLionel Sambuc.\" without specific prior written permission. 21*ebfedea0SLionel Sambuc.\" 22*ebfedea0SLionel Sambuc.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 23*ebfedea0SLionel Sambuc.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24*ebfedea0SLionel Sambuc.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25*ebfedea0SLionel Sambuc.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 26*ebfedea0SLionel Sambuc.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27*ebfedea0SLionel Sambuc.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28*ebfedea0SLionel Sambuc.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29*ebfedea0SLionel Sambuc.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30*ebfedea0SLionel Sambuc.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31*ebfedea0SLionel Sambuc.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32*ebfedea0SLionel Sambuc.\" SUCH DAMAGE. 33*ebfedea0SLionel Sambuc.\" 34*ebfedea0SLionel Sambuc.\" Id 35*ebfedea0SLionel Sambuc.\" 36*ebfedea0SLionel Sambuc.Dd February 29, 2004 37*ebfedea0SLionel Sambuc.Dt KADM5_PWCHECK 3 38*ebfedea0SLionel Sambuc.Os 39*ebfedea0SLionel Sambuc.Sh NAME 40*ebfedea0SLionel Sambuc.Nm krb5_pwcheck , 41*ebfedea0SLionel Sambuc.Nm kadm5_setup_passwd_quality_check , 42*ebfedea0SLionel Sambuc.Nm kadm5_add_passwd_quality_verifier , 43*ebfedea0SLionel Sambuc.Nm kadm5_check_password_quality 44*ebfedea0SLionel Sambuc.Nd Heimdal warning and error functions 45*ebfedea0SLionel Sambuc.Sh LIBRARY 46*ebfedea0SLionel SambucKerberos 5 Library (libkadm5srv, -lkadm5srv) 47*ebfedea0SLionel Sambuc.Sh SYNOPSIS 48*ebfedea0SLionel Sambuc.In kadm5-protos.h 49*ebfedea0SLionel Sambuc.In kadm5-pwcheck.h 50*ebfedea0SLionel Sambuc.Ft void 51*ebfedea0SLionel Sambuc.Fo kadm5_setup_passwd_quality_check 52*ebfedea0SLionel Sambuc.Fa "krb5_context context" 53*ebfedea0SLionel Sambuc.Fa "const char *check_library" 54*ebfedea0SLionel Sambuc.Fa "const char *check_function" 55*ebfedea0SLionel Sambuc.Fc 56*ebfedea0SLionel Sambuc.Ft "krb5_error_code" 57*ebfedea0SLionel Sambuc.Fo kadm5_add_passwd_quality_verifier 58*ebfedea0SLionel Sambuc.Fa "krb5_context context" 59*ebfedea0SLionel Sambuc.Fa "const char *check_library" 60*ebfedea0SLionel Sambuc.Fc 61*ebfedea0SLionel Sambuc.Ft "const char *" 62*ebfedea0SLionel Sambuc.Fo kadm5_check_password_quality 63*ebfedea0SLionel Sambuc.Fa "krb5_context context" 64*ebfedea0SLionel Sambuc.Fa "krb5_principal principal" 65*ebfedea0SLionel Sambuc.Fa "krb5_data *pwd_data" 66*ebfedea0SLionel Sambuc.Fc 67*ebfedea0SLionel Sambuc.Ft int 68*ebfedea0SLionel Sambuc.Fo "(*kadm5_passwd_quality_check_func)" 69*ebfedea0SLionel Sambuc.Fa "krb5_context context" 70*ebfedea0SLionel Sambuc.Fa "krb5_principal principal" 71*ebfedea0SLionel Sambuc.Fa "krb5_data *password" 72*ebfedea0SLionel Sambuc.Fa "const char *tuning" 73*ebfedea0SLionel Sambuc.Fa "char *message" 74*ebfedea0SLionel Sambuc.Fa "size_t length" 75*ebfedea0SLionel Sambuc.Fc 76*ebfedea0SLionel Sambuc.Sh DESCRIPTION 77*ebfedea0SLionel SambucThese functions perform the quality check for the heimdal database 78*ebfedea0SLionel Sambuclibrary. 79*ebfedea0SLionel Sambuc.Pp 80*ebfedea0SLionel SambucThere are two versions of the shared object API; the old version (0) 81*ebfedea0SLionel Sambucis deprecated, but still supported. The new version (1) supports 82*ebfedea0SLionel Sambucmultiple password quality checking policies in the same shared object. 83*ebfedea0SLionel SambucSee below for details. 84*ebfedea0SLionel Sambuc.Pp 85*ebfedea0SLionel SambucThe password quality checker will run all policies that are 86*ebfedea0SLionel Sambucconfigured by the user. If any policy rejects the password, the password 87*ebfedea0SLionel Sambucwill be rejected. 88*ebfedea0SLionel Sambuc.Pp 89*ebfedea0SLionel SambucPolicy names are of the form 90*ebfedea0SLionel Sambuc.Ql module-name:policy-name 91*ebfedea0SLionel Sambucor, if the the policy name is unique enough, just 92*ebfedea0SLionel Sambuc.Ql policy-name . 93*ebfedea0SLionel Sambuc.Sh IMPLEMENTING A PASSWORD QUALITY CHECKING SHARED OBJECT 94*ebfedea0SLionel Sambuc(This refers to the version 1 API only.) 95*ebfedea0SLionel Sambuc.Pp 96*ebfedea0SLionel SambucModule shared objects may conveniently be compiled and linked with 97*ebfedea0SLionel Sambuc.Xr libtool 1 . 98*ebfedea0SLionel SambucAn object needs to export a symbol called 99*ebfedea0SLionel Sambuc.Ql kadm5_password_verifier 100*ebfedea0SLionel Sambucof the type 101*ebfedea0SLionel Sambuc.Ft "struct kadm5_pw_policy_verifier" . 102*ebfedea0SLionel Sambuc.Pp 103*ebfedea0SLionel SambucIts 104*ebfedea0SLionel Sambuc.Ft name 105*ebfedea0SLionel Sambucand 106*ebfedea0SLionel Sambuc.Ft vendor 107*ebfedea0SLionel Sambucfields should contain the obvious information. 108*ebfedea0SLionel Sambuc.Ft name 109*ebfedea0SLionel Sambucmust match the 110*ebfedea0SLionel Sambuc.Ql module-name 111*ebfedea0SLionel Sambucportion of the policy name (the part before the colon), if the policy name 112*ebfedea0SLionel Sambuccontains a colon, or the policy will not be run. 113*ebfedea0SLionel Sambuc.Ft version 114*ebfedea0SLionel Sambucshould be 115*ebfedea0SLionel Sambuc.Dv KADM5_PASSWD_VERSION_V1 . 116*ebfedea0SLionel Sambuc.Pp 117*ebfedea0SLionel Sambuc.Ft funcs 118*ebfedea0SLionel Sambuccontains an array of 119*ebfedea0SLionel Sambuc.Ft "struct kadm5_pw_policy_check_func" 120*ebfedea0SLionel Sambucstructures that is terminated with an entry whose 121*ebfedea0SLionel Sambuc.Ft name 122*ebfedea0SLionel Sambuccomponent is 123*ebfedea0SLionel Sambuc.Dv NULL . 124*ebfedea0SLionel SambucThe 125*ebfedea0SLionel Sambuc.Ft name 126*ebfedea0SLionel Sambucfield of the array must match the 127*ebfedea0SLionel Sambuc.Ql policy-name 128*ebfedea0SLionel Sambucportion of a policy name (the part after the colon, or the complete policy 129*ebfedea0SLionel Sambucname if there is no colon) specified by the user or the policy will not be 130*ebfedea0SLionel Sambucrun. The 131*ebfedea0SLionel Sambuc.Ft func 132*ebfedea0SLionel Sambucfields of the array elements are functions that are exported by the 133*ebfedea0SLionel Sambucmodule to be called to check the password. They get the following 134*ebfedea0SLionel Sambucarguments: the Kerberos context, principal, password, a tuning parameter, and 135*ebfedea0SLionel Sambuca pointer to a message buffer and its length. The tuning parameter 136*ebfedea0SLionel Sambucfor the quality check function is currently always 137*ebfedea0SLionel Sambuc.Dv NULL . 138*ebfedea0SLionel SambucIf the password is acceptable, the function returns zero. Otherwise 139*ebfedea0SLionel Sambucit returns non-zero and fills in the message buffer with an 140*ebfedea0SLionel Sambucappropriate explanation. 141*ebfedea0SLionel Sambuc.Sh RUNNING THE CHECKS 142*ebfedea0SLionel Sambuc.Nm kadm5_setup_passwd_quality_check 143*ebfedea0SLionel Sambucsets up type 0 checks. It sets up all type 0 checks defined in 144*ebfedea0SLionel Sambuc.Xr krb5.conf 5 145*ebfedea0SLionel Sambucif called with the last two arguments null. 146*ebfedea0SLionel Sambuc.Pp 147*ebfedea0SLionel Sambuc.Nm kadm5_add_passwd_quality_verifier 148*ebfedea0SLionel Sambucsets up type 1 checks. It sets up all type 1 tests defined in 149*ebfedea0SLionel Sambuc.Xr krb5.conf 5 150*ebfedea0SLionel Sambucif called with a null second argument. 151*ebfedea0SLionel Sambuc.Nm kadm5_check_password_quality 152*ebfedea0SLionel Sambucruns the checks in the order in which they are defined in 153*ebfedea0SLionel Sambuc.Xr krb5.conf 5 154*ebfedea0SLionel Sambucand the order in which they occur in a 155*ebfedea0SLionel Sambucmodule's 156*ebfedea0SLionel Sambuc.Ft funcs 157*ebfedea0SLionel Sambucarray until one returns non-zero. 158*ebfedea0SLionel Sambuc.Sh SEE ALSO 159*ebfedea0SLionel Sambuc.Xr libtool 1 , 160*ebfedea0SLionel Sambuc.Xr krb5 3 , 161*ebfedea0SLionel Sambuc.Xr krb5.conf 5 162