From b9e663597463ecfe74ac0a67263425264ea49931 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 11 Dec 2015 14:48:37 +0000 Subject: Allow certificates with preamble before BEGIN CERTIFICATE (dcpomatic #774). --- src/certificate.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/certificate.cc b/src/certificate.cc index be043310..36aef7f9 100644 --- a/src/certificate.cc +++ b/src/certificate.cc @@ -90,8 +90,11 @@ Certificate::read_string (string cert) string line; /* BEGIN */ - getline (s, line); - boost::algorithm::trim (line); + do { + getline (s, line); + boost::algorithm::trim (line); + } while (s.good() && line != begin_certificate); + if (line != begin_certificate) { throw MiscError ("missing BEGIN line in certificate"); } -- cgit v1.2.3