diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-02-02 12:03:44 +0100 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-02-02 12:03:44 +0100 |
commit | c4704e163ebf54277ff901f06f09126ef3a3bc7f (patch) | |
tree | ce83c1d232bd48812fc4e65eb1a58c12780e4824 | |
parent | ce1453a45a71df51cddff914e2dcc196f3966a3a (diff) | |
download | monitoring-plugins-c4704e1.tar.gz |
sslutils.c: Move function after a function it uses to avoid forward declarations
-rw-r--r-- | plugins/sslutils.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/plugins/sslutils.c b/plugins/sslutils.c index 286273f6..4f12ddaf 100644 --- a/plugins/sslutils.c +++ b/plugins/sslutils.c | |||
@@ -191,17 +191,6 @@ int np_net_ssl_read(void *buf, int num) { | |||
191 | return SSL_read(s, buf, num); | 191 | return SSL_read(s, buf, num); |
192 | } | 192 | } |
193 | 193 | ||
194 | int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ | ||
195 | # ifdef USE_OPENSSL | ||
196 | X509 *certificate = NULL; | ||
197 | certificate=SSL_get_peer_certificate(s); | ||
198 | return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit)); | ||
199 | # else /* ifndef USE_OPENSSL */ | ||
200 | printf("%s\n", _("WARNING - Plugin does not support checking certificates.")); | ||
201 | return STATE_WARNING; | ||
202 | # endif /* USE_OPENSSL */ | ||
203 | } | ||
204 | |||
205 | int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ | 194 | int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int days_till_exp_crit){ |
206 | # ifdef USE_OPENSSL | 195 | # ifdef USE_OPENSSL |
207 | X509_NAME *subj=NULL; | 196 | X509_NAME *subj=NULL; |
@@ -328,4 +317,16 @@ int np_net_ssl_check_certificate(X509 *certificate, int days_till_exp_warn, int | |||
328 | # endif /* USE_OPENSSL */ | 317 | # endif /* USE_OPENSSL */ |
329 | } | 318 | } |
330 | 319 | ||
320 | int np_net_ssl_check_cert(int days_till_exp_warn, int days_till_exp_crit){ | ||
321 | # ifdef USE_OPENSSL | ||
322 | X509 *certificate = NULL; | ||
323 | certificate=SSL_get_peer_certificate(s); | ||
324 | return(np_net_ssl_check_certificate(certificate, days_till_exp_warn, days_till_exp_crit)); | ||
325 | # else /* ifndef USE_OPENSSL */ | ||
326 | printf("%s\n", _("WARNING - Plugin does not support checking certificates.")); | ||
327 | return STATE_WARNING; | ||
328 | # endif /* USE_OPENSSL */ | ||
329 | } | ||
330 | |||
331 | |||
331 | #endif /* HAVE_SSL */ | 332 | #endif /* HAVE_SSL */ |