File: crypto.h

package info (click to toggle)
ntp 1%3A4.2.8p12%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 32,472 kB
  • sloc: ansic: 240,078; sh: 6,859; makefile: 3,369; perl: 2,765; python: 1,486; yacc: 1,451; ruby: 817; awk: 417; sed: 47; asm: 37
file content (35 lines) | stat: -rw-r--r-- 799 bytes parent folder | download | duplicates (2)
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
30
31
32
33
34
35
#ifndef CRYPTO_H
#define CRYPTO_H

#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include <ntp_fp.h>
#include <ntp.h>
#include <ntp_stdlib.h>
#include <ntp_md5.h>	/* provides OpenSSL digest API */
#include "utilities.h"
#include "sntp-opts.h"

#define LEN_PKT_MAC	LEN_PKT_NOMAC + sizeof(u_int32)

/* #include "sntp-opts.h" */

struct key {
	struct key *	next;
	int		key_id;
	int		key_len;
	int		typei;
	char		typen[20];
	char		key_seq[64];
};

extern	int	auth_init(const char *keyfile, struct key **keys);
extern	void	get_key(int key_id, struct key **d_key);
extern	int	make_mac(const void *pkt_data, int pkt_size, int mac_size,
			 const struct key *cmp_key, void *digest);
extern	int	auth_md5(const void *pkt_data, int pkt_size, int mac_size,
			 const struct key *cmp_key);

#endif