KADM5_PWCHECK(3)

πŸ’– KADM5_PWCHECK πŸ’–

okay so bestie, welcome to the KADM5_PWCHECK(3) page β€” it lives in the Library Functions Manual and it's literally all about the Heimdal password quality checking situation. this is libkadm5srv territory, so buckle up πŸŽ€


✨ NAME ✨

krb5_pwcheck, kadm5_setup_passwd_quality_check, kadm5_add_passwd_quality_verifier, kadm5_check_password_quality β€” Heimdal warning and error functions πŸ’…


πŸ“š LIBRARY πŸ“š

Kerberos 5 Library (libkadm5srv, -lkadm5srv) πŸ¦‹


🌸 SYNOPSIS 🌸

#include <kadm5-protos.h>
#include <kadm5-pwcheck.h>

void
kadm5_setup_passwd_quality_check(krb5_context context,
    const char *check_library, const char *check_function);

krb5_error_code
kadm5_add_passwd_quality_verifier(krb5_context context,
    const char *check_library);

const char *
kadm5_check_password_quality(krb5_context context,
    krb5_principal principal, krb5_data *pwd_data);

int
(*kadm5_passwd_quality_check_func)(krb5_context context,
    krb5_principal principal, krb5_data *password, const char *tuning,
    char *message, size_t length);

πŸ‘‘ DESCRIPTION πŸ‘‘

so these functions? they do the quality check for the heimdal database library. that's the whole vibe 🫢

there are two versions of the shared object API. the old version (0) is deprecated but still supported, no cap. the new version (1) supports multiple password quality checking policies inside the same shared object. details below, keep reading πŸ’€

the password quality checker will run all the policies that are configured by the user. and if any policy rejects the password, the password gets rejected. periodt. βœ‹

policy names look like module-name:policy-name β€” or, if the policy name is unique enough, you can just say policy-name. slay ✨


🧚 IMPLEMENTING A PASSWORD QUALITY CHECKING SHARED OBJECT 🧚

(this one is about the version 1 API only, just so we're clear πŸ‘€)

module shared objects may conveniently be compiled and linked with libtool(1) β€” iconic. an object needs to export a symbol called kadm5_password_verifier of the type struct kadm5_pw_policy_verifier.

its name and vendor fields should contain the obvious information. name must match the module-name portion of the policy name (aka the part before the colon) if the policy name contains a colon β€” otherwise the policy will not be run, and we'd simply pass away 😭

version should be KADM5_PASSWD_VERSION_V1. yes ma'am.

funcs contains an array of struct kadm5_pw_policy_check_func structures that is terminated with an entry whose name component is NULL. the name field of the array must match the policy-name portion of a policy name (the part after the colon, or the complete policy name if there's no colon) specified by the user β€” or, again, the policy will not be run πŸ™ˆ

the func fields of the array elements are functions that are exported by the module to be called to check the password. they get the following arguments: the Kerberos context, principal, password, a tuning parameter, and a pointer to a message buffer and its length. and the tuning parameter for the quality check function is currently always NULL. noted. πŸ“

if the password is acceptable, the function returns zero. otherwise it returns non-zero and fills in the message buffer with an appropriate explanation. simple as that πŸ’…


πŸ”₯ RUNNING THE CHECKS πŸ”₯

  • kadm5_setup_passwd_quality_check sets up type 0 checks. it sets up all type 0 checks defined in krb5.conf(5) if called with the last two arguments null. πŸŽ€
  • kadm5_add_passwd_quality_verifier sets up type 1 checks. it sets up all type 1 tests defined in krb5.conf(5) if called with a null second argument. 🌈
  • kadm5_check_password_quality runs the checks in the order in which they are defined in krb5.conf(5) and the order in which they occur in a module's funcs array β€” until one returns non-zero. and then it's done, bestie πŸ›‘

πŸ‘€ SEE ALSO πŸ‘€

libtool(1), krb5(3), krb5.conf(5)


and that's the whole page fr fr πŸ’– this was HEIMDAL β€” the February 29, 2004 edition β€” signing off, mwah πŸ«Άβœ¨πŸ’…

πŸ“¦ where this page comes from