[Git][NTPsec/ntpsec][master] 2 commits: Dead-code removal. This was only used by ntpkeygen.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Dec 3 05:51:18 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
2468f884 by Eric S. Raymond at 2016-12-03T00:51:03-05:00
Dead-code removal.  This was only used by ntpkeygen.

- - - - -
aa83f3ea by Richard Laager at 2016-12-03T00:51:03-05:00
sodium_init() needs its return value checked

I have fixed the one call to sodium_init().  I also imported the
warn_unused_result from my system's sodium/core.h to avoid this going
unnoticed if future calls to sodium_init() are added.

- - - - -


4 changed files:

- include/ntp_stdlib.h
- libntp/ssl_init.c
- libsodium/include/sodium/core.h
- ntpd/ntpd.c


Changes:

=====================================
include/ntp_stdlib.h
=====================================
--- a/include/ntp_stdlib.h
+++ b/include/ntp_stdlib.h
@@ -206,7 +206,6 @@ extern pset_tod_using	set_tod_using;
 /* ssl_init.c */
 #ifdef HAVE_OPENSSL
 extern	void	ssl_init		(void);
-extern	void	ssl_check_version	(void);
 extern	bool	ssl_init_done;
 #define	INIT_SSL()				\
 	do {					\


=====================================
libntp/ssl_init.c
=====================================
--- a/libntp/ssl_init.c
+++ b/libntp/ssl_init.c
@@ -47,22 +47,6 @@ atexit_ssl_cleanup(void)
 	EVP_cleanup();
 	ERR_free_strings();
 }
-
-
-void
-ssl_check_version(void)
-{
-	if ((SSLeay() ^ OPENSSL_VERSION_NUMBER) & ~0xff0L) {
-		msyslog(LOG_WARNING,
-		    "OpenSSL version mismatch. Built against %lx, you have %lx",
-		    (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
-		fprintf(stderr,
-		    "OpenSSL version mismatch. Built against %lx, you have %lx\n",
-		    (u_long)OPENSSL_VERSION_NUMBER, SSLeay());
-	}
-
-	INIT_SSL();
-}
 #endif	/* HAVE_OPENSSL */
 
 


=====================================
libsodium/include/sodium/core.h
=====================================
--- a/libsodium/include/sodium/core.h
+++ b/libsodium/include/sodium/core.h
@@ -9,7 +9,8 @@ extern "C" {
 #endif
 
 SODIUM_EXPORT
-int sodium_init(void);
+int sodium_init(void)
+            __attribute__ ((warn_unused_result));
 
 #ifdef __cplusplus
 }


=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -663,7 +663,10 @@ ntpdmain(
         /*
 	 * Initialize libsodium and its RNG
 	 */
-	sodium_init();
+	if (sodium_init() < 0) {
+		msyslog(LOG_ERR, "sodium_init() failed");
+		exit(1);
+	}
 
 	/*
 	 * Set up signals we pay attention to locally.



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/d76f35196b82ad6bb5c0a29920aac2765c63c9f3...aa83f3eaea29d6e5d562fa08b47443a82fe3382a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161203/e0235034/attachment.html>


More information about the vc mailing list