Improve detection of other stuff after certificates.
[libdcp.git] / src / certificate.cc
index fd767fa7ea78a42f6c48cccc2c99bb79d9f81127..7448dd597df7c4f742a38b8a2d66c0dcca279da1 100644 (file)
@@ -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 */