From: Harlan Stenn Date: Thu, 10 May 2007 00:42:07 +0000 (-0400) Subject: Build even if no OPENSSL X-Git-Tag: NTP_4_2_5P30~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66bd443fe56852e593124a3014e61d1218707873;p=thirdparty%2Fntp.git Build even if no OPENSSL bk: 46426a5fDO0N_PuWEWxzoZ1C5iezMA --- diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index ba88701f0..4ef28d2d5 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -866,7 +866,13 @@ static void config_auth(void) while (!empty(my_config.auth.crypto_cmd_list)) { my_val = (struct attr_val *) dequeue(my_config.auth.crypto_cmd_list); - crypto_config(my_val->attr, my_val->value.s); + #ifdef OPENSSL + crypto_config(my_val->attr, my_val->value.s); + #else + printf("Warning: Code not built with OpenSSL libraries!\n" + "Crypto commands are ignored\n"); + msyslog(LOG_ERR, "config_auth: Crypto commands are ignored\n"); + #endif free(my_val->value.s); free_node(my_val); @@ -1464,7 +1470,11 @@ static void config_vars(void) free(curr_var->value.s); break; case T_Automax: - sys_automax = 1 << max(curr_var->value.i, 10); + #ifdef OPENSSL + sys_automax = 1 << max(curr_var->value.i, 10); + #else + printf("Warning: Automax command ignored!\n"); + #endif break; } free_node(curr_var); diff --git a/ntpd/ntp_parser.y b/ntpd/ntp_parser.y index de924d146..c7aa507c6 100644 --- a/ntpd/ntp_parser.y +++ b/ntpd/ntp_parser.y @@ -39,6 +39,29 @@ struct FILE_INFO *ip_file; /* Pointer to the configuration file stream */ void yyerror (char *msg); + + /* SK: The following is a terrible hack to allow the NTP code to be built + * without OPENSSL. The following symbols need to be defined in the + * here because bison will balk at the presence of a C like preprocesser + * directive in the rules section. + * + * There should be a better way of doing this... + */ +#ifndef OPENSSL + #define CRYPTO_CONF_NONE 0 + #define CRYPTO_CONF_PRIV 1 + #define CRYPTO_CONF_SIGN 2 + #define CRYPTO_CONF_LEAP 3 + #define CRYPTO_CONF_KEYS 4 + #define CRYPTO_CONF_CERT 5 + #define CRYPTO_CONF_RAND 6 + #define CRYPTO_CONF_TRST 7 + #define CRYPTO_CONF_IFFPAR 8 + #define CRYPTO_CONF_GQPAR 9 + #define CRYPTO_CONF_MVPAR 10 + #define CRYPTO_CONF_PW 11 + #define CRYPTO_CONF_IDENT 12 +#endif %} %union {