From ed81e7f34255c4cde953ae6fa4148dd7edb362fa Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Apr 2016 11:44:50 +0100 Subject: Improve detection of other stuff after certificates. --- src/certificate.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/certificate.cc b/src/certificate.cc index fd767fa7..7448dd59 100644 --- a/src/certificate.cc +++ b/src/certificate.cc @@ -142,11 +142,12 @@ Certificate::read_string (string cert) BIO_free (bio); + /* See if there are any non-blank lines after the certificate that we read */ line.clear (); - if (s.good ()) { + while (s.good() && line.empty()) { getline (s, line); } - return !line.empty(); + return (s.good() && !line.empty()); } /** Destructor */ -- cgit v1.2.3