]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Build even if no OPENSSL
authorHarlan Stenn <stenn@ntp.org>
Thu, 10 May 2007 00:42:07 +0000 (20:42 -0400)
committerHarlan Stenn <stenn@ntp.org>
Thu, 10 May 2007 00:42:07 +0000 (20:42 -0400)
bk: 46426a5fDO0N_PuWEWxzoZ1C5iezMA

ntpd/ntp_config.c
ntpd/ntp_parser.y

index ba88701f033ce802565e703fd1d765301a236ec4..4ef28d2d50044c542028e8c5719e394f49743038 100644 (file)
@@ -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);
index de924d1460b8019d41c298d19ee10f62d304904f..c7aa507c6cef2fe07ef00b682940684851cc0ed1 100644 (file)
 
   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 {