freebsd-nq/sntp/crypto.h
Cy Schubert b5e14a1344 Vendor import ntp 4.2.8.
Reviewed by:	roberto
Security:	VUXML: 4033d826-87dd-11e4-9079-3c970e169bc2
Security:	http://www.kb.cert.org/vuls/id/852879
Security:	CVE-2014-9293
Security	CVE-2014-9294
Security	CVE-2014-9295
Security	CVE-2014-9296
2014-12-20 22:52:39 +00:00

33 lines
720 B
C

#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;
char type[10];
char key_seq[64];
};
int auth_init(const char *keyfile, struct key **keys);
void get_key(int key_id, struct key **d_key);
int make_mac(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char *digest);
int auth_md5(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key);
#endif