Header And Logo

PostgreSQL
| The world's most advanced open source database.

md5.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * md5.h
00004  *    Interface to libpq/md5.c
00005  *
00006  * These definitions are needed by both frontend and backend code to work
00007  * with MD5-encrypted passwords.
00008  *
00009  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00010  * Portions Copyright (c) 1994, Regents of the University of California
00011  *
00012  * src/include/libpq/md5.h
00013  *
00014  *-------------------------------------------------------------------------
00015  */
00016 #ifndef PG_MD5_H
00017 #define PG_MD5_H
00018 
00019 #define MD5_PASSWD_LEN  35
00020 
00021 #define isMD5(passwd)   (strncmp(passwd, "md5", 3) == 0 && \
00022                          strlen(passwd) == MD5_PASSWD_LEN)
00023 
00024 
00025 extern bool pg_md5_hash(const void *buff, size_t len, char *hexsum);
00026 extern bool pg_md5_binary(const void *buff, size_t len, void *outbuf);
00027 extern bool pg_md5_encrypt(const char *passwd, const char *salt,
00028                size_t salt_len, char *buf);
00029 
00030 #endif