1258945Sroberto#ifndef CRYPTO_H 2258945Sroberto#define CRYPTO_H 3258945Sroberto 4258945Sroberto#include <string.h> 5258945Sroberto#include <stdio.h> 6258945Sroberto#include <stdlib.h> 7258945Sroberto 8258945Sroberto#include <ntp_fp.h> 9258945Sroberto#include <ntp.h> 10258945Sroberto#include <ntp_stdlib.h> 11280849Scy#include <ntp_md5.h> /* provides OpenSSL digest API */ 12258945Sroberto#include "utilities.h" 13258945Sroberto#include "sntp-opts.h" 14258945Sroberto 15258945Sroberto#define LEN_PKT_MAC LEN_PKT_NOMAC + sizeof(u_int32) 16258945Sroberto 17258945Sroberto/* #include "sntp-opts.h" */ 18258945Sroberto 19258945Srobertostruct key { 20294569Sdelphij struct key * next; 21294569Sdelphij int key_id; 22294569Sdelphij int key_len; 23330141Sdelphij int typei; 24330141Sdelphij char typen[20]; 25294569Sdelphij char key_seq[64]; 26258945Sroberto}; 27258945Sroberto 28294569Sdelphijextern int auth_init(const char *keyfile, struct key **keys); 29294569Sdelphijextern void get_key(int key_id, struct key **d_key); 30294569Sdelphijextern int make_mac(const void *pkt_data, int pkt_size, int mac_size, 31294569Sdelphij const struct key *cmp_key, void *digest); 32294569Sdelphijextern int auth_md5(const void *pkt_data, int pkt_size, int mac_size, 33294569Sdelphij const struct key *cmp_key); 34258945Sroberto 35258945Sroberto#endif 36