[BACK]Return to ntp_crypto.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / dist / ntp / include

File: [cvs.NetBSD.org] / src / dist / ntp / include / Attic / ntp_crypto.h (download)

Revision 1.1.1.1 (vendor branch), Sat Apr 22 14:52:42 2000 UTC (24 years ago) by simonb
Branch: UDEL
CVS Tags: ntp-4-0-99i, netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl, fvdl_fs64_base
Changes since 1.1: +0 -0 lines

Import ntp 4.0.99i

/*	$NetBSD: ntp_crypto.h,v 1.1.1.1 2000/04/22 14:52:42 simonb Exp $	*/

/*
 * ntp_crypto.h - definitions for cryptographic operations
 */
#ifdef AUTOKEY
#include "global.h"
#include "md5.h"
#ifdef PUBKEY
#include "rsaref.h"
#include "rsa.h"
#endif /* PUBKEY */

/*
 * Extension field definitions
 */
#define CRYPTO_NULL	0	/* no operation */
#define CRYPTO_PUBL	1	/* public key */
#define CRYPTO_ASSOC	2	/* association ID */
#define CRYPTO_AUTO	3	/* autokey values */
#define CRYPTO_PRIV	4	/* cookie value (client/server) */
#define CRYPTO_DH	5	/* Diffie-Hellman value (symmetric) */
#define CRYPTO_NAME	6	/* host name */
#define CRYPTO_RESP	0x80	/* response */
#define CRYPTO_ERROR	0x40	/* error */

/*
 * Cryptoflags
 */
#define CRYPTO_FLAG_NONE  0x00	/* nothing happening */
#define CRYPTO_FLAG_PUBL  0x01	/* read peer public key from file */

#ifdef PUBKEY

#define MAX_DH_LEN (DH_PRIME_LEN(1024)) /* max agreed key length */

/*
 * Configuration codes
 */
#define CRYPTO_CONF_NONE  0	/* nothing doing */
#define CRYPTO_CONF_FLAGS 1	/* initialize flags */
#define CRYPTO_CONF_PRIV  2	/* load private key from file */
#define CRYPTO_CONF_PUBL  3	/* load public key from file */
#define CRYPTO_CONF_DH    4	/* load Diffie_Hellman pars from file */
#define CRYPTO_CONF_KEYS  5 	/* set keys directory path */
#endif /* PUBKEY */

/*
 * Function prototypes
 */
extern  void    crypto_recv     P((struct peer *, struct recvbuf *));
extern  int     crypto_xmit     P((u_int32 *, int, u_int, keyid_t,
				    int));
extern	keyid_t	session_key	P((struct sockaddr_in *, struct
				    sockaddr_in *, keyid_t, keyid_t,
				    u_long));
extern	void	make_keylist	P((struct peer *));
extern	void	key_expire	P((struct peer *));
extern	void	crypto_agree	P((void));
#ifdef PUBKEY
extern	void	crypto_init	P((void));
extern	void	crypto_config	P((int, char *));
extern	void	crypto_setup	P((void));
extern	int	crypto_public	P((struct peer *, u_char *));

/*
 * Cryptographic values
 */
extern	int			crypto_enable;
extern	int			crypto_flags;
extern	char *			private_key_file;
extern	char *			public_key_file;
extern	char *			dh_params_file;
#endif /* PUBKEY */
#endif /* AUTOKEY */