HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
36 Functions for handling passwords
This chapter contains reference information on routines for handling passwords. The routines
are listed in Chapter 36 “Functions for handling passwords”.
Table 36-1 Password handling routines
DescriptionFunction
Determines whether a specified password matches one of the encrypted values
of an attribute.
slapi_pw_find_sv()
Checks whether a value is encoded with any known algorithm.“slapi_is_encoded()”
Encodes a value with the specified algorithm.“slapi_encode()”
Sends back a password expired notification or password expiration warning.“slapi_add_pwd_control()”
Sends back information on the server password policy.“slapi_pwpolicy_make_response_control()”
36.1 slapi_pw_find_sv()
Description This function replaces the deprecated slapi_pw_find() function from previous
Directory Server releases.
When the Directory Server stores the password for an entry in the userpassword attribute, it
encodes the password using different schemes. Supported schemes are
SSHA (default)
SHA
CRYPT
CLEAR
Use this function to determine if a given password is one of the values of the userpassword
attribute. This function determines which password scheme was used to store the password and
uses the appropriate comparison function to compare a given value against the encoded values
of the userpassword attribute.
Syntax
#include "slapi-plugin.h"
int slapi_pw_find_sv( Slapi_Value **vals, const Slapi_Value *v );
Parameters This function takes the following parameters:
Pointer to the array of Slapi_Value structure pointers, containing the values of an
attribute that stores passwords (for example, the userpassword attribute).
vals
Pointer to the Slapi_Value structure containing the password that you wish to check;
for example, you can get this value from the SLAPI_BIND_CREDENTIALS parameter
in the parameter block and create the Slapi_Value using
slapi_value_init_berval().
v
Returns This function returns one of the following values:
0 if the password specified by v was found in vals.
A nonzero value if the password v was not found in vals.
See also
“slapi_is_encoded()”
“slapi_encode()”
36.1 slapi_pw_find_sv() 291