File: ntp_md5.h

package info (click to toggle)
ntp 1%3A4.2.6.p5%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 22,056 kB
  • sloc: ansic: 144,116; sh: 12,381; perl: 1,401; makefile: 1,274; yacc: 1,034; awk: 417; asm: 37; sed: 7
file content (29 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * ntp_md5.h: deal with md5.h headers
 *
 * Use the system MD5 if available, otherwise libisc's.
 */
#if defined HAVE_MD5_H && defined HAVE_MD5INIT
# include <md5.h>
#else
# include "isc/md5.h"
  typedef isc_md5_t		MD5_CTX;
# define MD5Init(c)		isc_md5_init(c)
# define MD5Update(c, p, s)	isc_md5_update(c, p, s)
# define MD5Final(d, c)		isc_md5_final((c), (d))	/* swapped */
#endif

/*
 * Provide OpenSSL-alike MD5 API if we're not using OpenSSL
 */
#ifndef OPENSSL
  typedef MD5_CTX			EVP_MD_CTX;
# define EVP_get_digestbynid(t)		NULL
# define EVP_DigestInit(c, dt)		MD5Init(c)
# define EVP_DigestUpdate(c, p, s)	MD5Update(c, p, s)
# define EVP_DigestFinal(c, d, pdl)	\
	do {				\
		MD5Final((d), (c));	\
		*(pdl) = 16;		\
	} while (0)
#endif