Chapter 36. Functions for Handling Passwords
Table 36.1. Password Handling Routines
| Function | Description |
|---|---|
| slapi_pw_find_sv() | Determines whether a specified password matches one of the encrypted values of an attribute. |
| slapi_is_encoded() | Checks whether a value is encoded with any known algorithm. |
| slapi_encode() | Encodes a value with the specified algorithm. |
| slapi_add_pwd_control() | Sends back a password expired notification or password expiration warning. |
| slapi_pwpolicy_make_response_control() | Sends back information on the server password policy. |
36.1. slapi_pw_find_sv()
This function replaces the deprecated slapi_pw_find() function from previous Directory Server releases.
userpassword attribute, it encodes the password using different schemes. Supported schemes are SSHA (default), SHA, CRYPT, and CLEAR.
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.
#include "slapi-plugin.h" int slapi_pw_find_sv( Slapi_Value **vals, const Slapi_Value *v );
This function takes the following parameters:
|
vals
| Pointer to the array of Slapi_Value structure pointers, containing the values of an attribute that stores passwords (for example, the userpassword attribute). |
|
v
| 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(). |
This function returns one of the following values:
- 0 if the password specified by v was found in vals.
- A non-zero value if the password v was not found in vals.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.