xref: /netbsd-src/external/bsd/ntp/dist/sntp/crypto.h (revision a5847cc334d9a7029f6352b847e9e8d71a0f9e0c)
1 /*	$NetBSD: crypto.h,v 1.1.1.1 2009/12/13 16:57:10 kardel Exp $	*/
2 
3 #ifndef CRYPTO_H
4 #define CRYPTO_H
5 
6 #include <string.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 
10 #include <ntp_fp.h>
11 #include <ntp.h>
12 #include <ntp_md5.h>
13 #include <ntp_stdlib.h>
14 
15 #include "utilities.h"
16 #include "sntp-opts.h"
17 
18 #define LEN_PKT_MAC	LEN_PKT_NOMAC + sizeof(u_int32)
19 
20 /* #include "sntp-opts.h" */
21 
22 struct key {
23 	int key_id;
24 	int key_len;
25 	char type;
26 	char key_seq[16];
27 	struct key *next;
28 };
29 
30 int auth_md5(char *pkt_data, int mac_size, struct key *cmp_key);
31 int auth_init(const char *keyfile, struct key **keys);
32 void get_key(int key_id, struct key **d_key);
33 
34 
35 #endif
36