We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b763a75 commit 3b229a3Copy full SHA for 3b229a3
asn1crypto/pem.py
@@ -14,6 +14,7 @@
14
import base64
15
import re
16
import sys
17
+import string
18
19
from ._errors import unwrap
20
from ._types import type_name as _type_name, str_cls, byte_cls
@@ -150,8 +151,8 @@ def _unarmor(pem_bytes):
150
151
152
if state == "trash":
153
# Look for a starting line since some CA cert bundle show the cert
- # into in a parsed format above each PEM block
154
- type_name_match = re.match(b'^(?:---- |-----)BEGIN ([A-Z0-9 ]+)(?: ----|-----)', line)
+ # info in a parsed format above each PEM block
155
+ type_name_match = re.match(br'''^(?:---- |-----)BEGIN ([0-9a-zA-Z!"#$%&'()*+,./:;<=>?@\\[\]^_`{|}~ ]+)(?: ----|-----)''', line)
156
if not type_name_match:
157
continue
158
object_type = type_name_match.group(1).decode('ascii')
0 commit comments