File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ntp / sntp / crypto.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue May 29 12:08:38 2012 UTC (12 years, 2 months ago) by misho
Branches: ntp, MAIN
CVS tags: v4_2_6p5p0, v4_2_6p5, HEAD
ntp 4.2.6p5

    1: #ifndef CRYPTO_H
    2: #define CRYPTO_H
    3: 
    4: #include <string.h>
    5: #include <stdio.h>
    6: #include <stdlib.h>
    7: 
    8: #include <ntp_fp.h>
    9: #include <ntp.h>
   10: #include <ntp_stdlib.h>
   11: #ifdef OPENSSL
   12: # include "openssl/evp.h"
   13: #else
   14: # include <ntp_md5.h>		/* provides clone of OpenSSL MD5 API */
   15: #endif
   16: #include "utilities.h"
   17: #include "sntp-opts.h"
   18: 
   19: #define LEN_PKT_MAC	LEN_PKT_NOMAC + sizeof(u_int32)
   20: 
   21: /* #include "sntp-opts.h" */
   22: 
   23: struct key {
   24: 	struct key *next;
   25: 	int key_id;
   26: 	int key_len;
   27: 	char type[10];
   28: 	char key_seq[64];
   29: };
   30: 
   31: int auth_init(const char *keyfile, struct key **keys);
   32: void get_key(int key_id, struct key **d_key);
   33: int make_mac(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key, char *digest);
   34: int auth_md5(char *pkt_data, int pkt_size, int mac_size, struct key *cmp_key);
   35: 
   36: #endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>