~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/include/libpq/crypt.h

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * crypt.h
 
4
 *        Interface to libpq/crypt.c
 
5
 *
 
6
 * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
 
7
 * Portions Copyright (c) 1994, Regents of the University of California
 
8
 *
 
9
 * $PostgreSQL: pgsql/src/include/libpq/crypt.h,v 1.30 2004-12-31 22:03:32 pgsql Exp $
 
10
 *
 
11
 *-------------------------------------------------------------------------
 
12
 */
 
13
#ifndef PG_CRYPT_H
 
14
#define PG_CRYPT_H
 
15
 
 
16
#include "libpq/libpq-be.h"
 
17
 
 
18
#define MD5_PASSWD_LEN  35
 
19
 
 
20
#define isMD5(passwd)   (strncmp((passwd),"md5",3) == 0 && \
 
21
                                                 strlen(passwd) == MD5_PASSWD_LEN)
 
22
 
 
23
 
 
24
extern int md5_crypt_verify(const Port *port, const char *user,
 
25
                                 char *client_pass);
 
26
extern bool md5_hash(const void *buff, size_t len, char *hexsum);
 
27
extern bool CheckMD5Pwd(char *passwd, char *storedpwd, char *seed);
 
28
 
 
29
extern bool EncryptMD5(const char *passwd, const char *salt,
 
30
                   size_t salt_len, char *buf);
 
31
 
 
32
#endif