3 * Copyright 1998-2000 The OpenLDAP Foundation, Redwood City, California, USA
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
15 #include <ldap_cdefs.h>
16 #include <lber_types.h>
19 * Include file for LDAP utility routine
24 /* n octets encode into ceiling(n/3) * 4 bytes */
25 /* Avoid floating point math by through extra padding */
27 #define LUTIL_BASE64_ENCODE_LEN(n) ((n)/3 * 4 + 4)
28 #define LUTIL_BASE64_DECODE_LEN(n) ((n)/4 * 3)
30 /* ISC Base64 Routines */
34 lutil_b64_ntop LDAP_P((
35 unsigned char const *,
41 lutil_b64_pton LDAP_P((
54 lutil_entropy LDAP_P((
59 struct berval; /* avoid pulling in lber.h */
62 lutil_authpasswd LDAP_P((
63 const struct berval *passwd, /* stored password */
64 const struct berval *cred, /* user supplied value */
65 const char **methods ));
68 lutil_authpasswd_hash LDAP_P((
69 const struct berval *cred,
70 struct berval **passwd, /* password to store */
71 struct berval **salt, /* salt to store */
72 const char *method ));
74 #if defined( SLAPD_SPASSWD ) && defined( HAVE_CYRUS_SASL )
75 /* cheat to avoid pulling in <sasl.h> */
76 LIBLUTIL_F( struct sasl_conn * ) lutil_passwd_sasl_conn;
81 const struct berval *passwd, /* stored password */
82 const struct berval *cred, /* user supplied value */
83 const char **methods ));
85 LIBLUTIL_F( struct berval * )
86 lutil_passwd_generate LDAP_P(( ber_len_t ));
88 LIBLUTIL_F( struct berval * )
89 lutil_passwd_hash LDAP_P((
90 const struct berval *passwd,
91 const char *method ));
94 lutil_passwd_scheme LDAP_P((
95 const char *scheme ));
99 lutil_progname LDAP_P((
106 lutil_pair( LBER_SOCKET_T sd[2] );
110 #endif /* _LUTIL_H */