diff options
author | Xin LI <delphij@FreeBSD.org> | 2018-08-20 06:07:33 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2018-08-20 06:07:33 +0000 |
commit | c7f4d2332394d5600fe4e14c530ede36b0ff29b0 (patch) | |
tree | be0b200d6dc09373927db61d685acc61113c64c1 /include | |
parent | d14ac12f8738acac881f20b4d6244cfc22c68ead (diff) |
Notes
Diffstat (limited to 'include')
-rw-r--r-- | include/ntp.h | 12 | ||||
-rw-r--r-- | include/ntp_md5.h | 7 |
2 files changed, 18 insertions, 1 deletions
diff --git a/include/ntp.h b/include/ntp.h index fb739c756848..cfbb7d2e7a47 100644 --- a/include/ntp.h +++ b/include/ntp.h @@ -610,6 +610,18 @@ struct pkt { #define STRATUM_TO_PKT(s) ((u_char)(((s) == (STRATUM_UNSPEC)) ?\ (STRATUM_PKT_UNSPEC) : (s))) + +/* + * A test to determine if the refid should be interpreted as text string. + * This is usually the case for a refclock, which has stratum 0 internally, + * which results in sys_stratum 1 if the refclock becomes system peer, or + * in case of a kiss-of-death (KoD) packet that has STRATUM_PKT_UNSPEC (==0) + * in the packet which is converted to STRATUM_UNSPEC when the packet + * is evaluated. + */ +#define REFID_ISTEXT(s) (((s) <= 1) || ((s) >= STRATUM_UNSPEC)) + + /* * Event codes. Used for reporting errors/events to the control module */ diff --git a/include/ntp_md5.h b/include/ntp_md5.h index 01b417a80516..06c90b2d2faf 100644 --- a/include/ntp_md5.h +++ b/include/ntp_md5.h @@ -7,8 +7,13 @@ #define NTP_MD5_H #ifdef OPENSSL -# include "openssl/evp.h" +# include <openssl/evp.h> # include "libssl_compat.h" +# ifdef HAVE_OPENSSL_CMAC_H +# include <openssl/cmac.h> +# define CMAC "AES128CMAC" +# define AES_128_KEY_SIZE 16 +# endif /*HAVE_OPENSSL_CMAC_H*/ #else /* !OPENSSL follows */ /* * Provide OpenSSL-alike MD5 API if we're not using OpenSSL |