From 7b5542cc8a3cdd2266e043f084a8f60c52908640 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Fri, 2 Aug 2013 10:52:58 -0500 Subject: [PATCH] X509: re-use existing BER extraction code --- phpseclib/File/X509.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phpseclib/File/X509.php b/phpseclib/File/X509.php index 9c167db5..5714deb8 100644 --- a/phpseclib/File/X509.php +++ b/phpseclib/File/X509.php @@ -4041,9 +4041,7 @@ class File_X509 { } // If in PEM format, convert to binary. - if (preg_match('#^-----BEGIN #', $key)) { - $key = base64_decode(preg_replace('#-.+-|[\r\n]#', '', $key)); - } + $key = $this->_extractBER($key); // Now we have the key string: compute its sha-1 sum. if (!class_exists('Crypt_Hash')) {