freebsd-src/contrib/ntp/sntp/crypto.h
Cy Schubert e6bfd18d21 ntp: import ntp-4.2.8p17
Fixes two small bugs including one regression.

MFC after:	3 days

Merge commit 'ab1f1aa8333369a83ff284848fc3fc2e52d5f29f'
2023-06-06 05:44:51 -07:00

35 lines
744 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 "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