Eneboo - Documentación para desarrolladores
|
00001 /*------------------------------------------------------------------------- 00002 * 00003 * crypt.h 00004 * Interface to libpq/crypt.c 00005 * 00006 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group 00007 * Portions Copyright (c) 1994, Regents of the University of California 00008 * 00009 * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.32.2.1 2005/11/22 18:23:28 momjian Exp $ 00010 * 00011 *------------------------------------------------------------------------- 00012 */ 00013 #ifndef PG_CRYPT_H 00014 #define PG_CRYPT_H 00015 00016 #include "libpq/libpq-be.h" 00017 00018 #define MD5_PASSWD_LEN 35 00019 00020 #define isMD5(passwd) (strncmp(passwd, "md5", 3) == 0 && \ 00021 strlen(passwd) == MD5_PASSWD_LEN) 00022 00023 00024 /* in crypt.c */ 00025 extern int md5_crypt_verify(const Port *port, const char *user, 00026 char *client_pass); 00027 00028 /* in md5.c --- these are also present in frontend libpq */ 00029 extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum); 00030 extern bool pg_md5_encrypt(const char *passwd, const char *salt, 00031 size_t salt_len, char *buf); 00032 00033 #endif