154925bf6Swillf /*
254925bf6Swillf  * lib/kdb/kdb_ldap/ldap_service_stash.h
354925bf6Swillf  *
454925bf6Swillf  * Copyright (c) 2004-2005, Novell, Inc.
554925bf6Swillf  * All rights reserved.
654925bf6Swillf  *
754925bf6Swillf  * Redistribution and use in source and binary forms, with or without
854925bf6Swillf  * modification, are permitted provided that the following conditions are met:
954925bf6Swillf  *
1054925bf6Swillf  *   * Redistributions of source code must retain the above copyright notice,
1154925bf6Swillf  *       this list of conditions and the following disclaimer.
1254925bf6Swillf  *   * Redistributions in binary form must reproduce the above copyright
1354925bf6Swillf  *       notice, this list of conditions and the following disclaimer in the
1454925bf6Swillf  *       documentation and/or other materials provided with the distribution.
1554925bf6Swillf  *   * The copyright holder's name is not used to endorse or promote products
1654925bf6Swillf  *       derived from this software without specific prior written permission.
1754925bf6Swillf  *
1854925bf6Swillf  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1954925bf6Swillf  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2054925bf6Swillf  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2154925bf6Swillf  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2254925bf6Swillf  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2354925bf6Swillf  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2454925bf6Swillf  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2554925bf6Swillf  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2654925bf6Swillf  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2754925bf6Swillf  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2854925bf6Swillf  * POSSIBILITY OF SUCH DAMAGE.
2954925bf6Swillf  */
3054925bf6Swillf 
3154925bf6Swillf #ifndef LDAP_SERVICE_STASH_H
3254925bf6Swillf #define LDAP_SERVICE_STASH_H 1
3354925bf6Swillf 
3454925bf6Swillf #define RECORDLEN 1024
3554925bf6Swillf struct data{
3654925bf6Swillf     int           len;
3754925bf6Swillf     unsigned char *value;
3854925bf6Swillf };
3954925bf6Swillf 
4054925bf6Swillf #define ERR_NO_MEM      1
4154925bf6Swillf #define ERR_PWD_ZERO    2
4254925bf6Swillf #define ERR_PWD_BAD     3
4354925bf6Swillf #define ERR_PWD_NOT_HEX 4
4454925bf6Swillf 
45*1da57d55SToomas Soome int
4654925bf6Swillf dec_password(struct data, struct data *);
4754925bf6Swillf 
4854925bf6Swillf krb5_error_code
4954925bf6Swillf krb5_ldap_readpassword(krb5_context, krb5_ldap_context *, unsigned char **);
5054925bf6Swillf 
51*1da57d55SToomas Soome int
5254925bf6Swillf tohex(krb5_data, krb5_data *);
5354925bf6Swillf 
5454925bf6Swillf #endif
5554925bf6Swillf 
56