x509: remove the strip_header() function

We don't need the strip_header() function, to load an unknown
x509 certificate, load_unknown_x509_certificate() should be used.

Reviewed-By: Tibor Dudlak <tdudlak@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Laznicka
2017-11-01 07:55:04 +01:00
parent d65297311d
commit c9265a7b05
5 changed files with 26 additions and 27 deletions
+2 -1
View File
@@ -206,6 +206,7 @@ class cert_find(MethodOverride):
raise errors.MutuallyExclusiveError(
reason=_("cannot specify both raw certificate and file"))
if 'certificate' not in options and 'file' in options:
options['certificate'] = x509.strip_header(options.pop('file'))
options['certificate'] = x509.load_unknown_x509_certificate(
options.pop('file'))
return super(cert_find, self).forward(*args, **options)
+1 -1
View File
@@ -40,7 +40,7 @@ class certmap_match(MethodOverride):
raise errors.MutuallyExclusiveError(
reason=_("cannot specify both raw certificate and file"))
if args:
args = [x509.strip_header(args[0])]
args = [x509.load_unknown_x509_certificate(args[0])]
elif 'certificate' in options:
args = [options.pop('certificate')]
else: