mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Load certificate files as binary data
In Python 3, cryptography requires certificate data to be binary. Even PEM encoded files are treated as binary content. certmap-match and cert-find were loading certificates as text files. A new BinaryFile type loads files as binary content. Fixes: https://pagure.io/freeipa/issue/7520 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Stanislav Laznicka <slaznick@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
@@ -27,7 +27,7 @@ from ipaclient.frontend import MethodOverride
|
||||
from ipalib import errors
|
||||
from ipalib import x509
|
||||
from ipalib import util
|
||||
from ipalib.parameters import File, Flag, Str
|
||||
from ipalib.parameters import BinaryFile, File, Flag, Str
|
||||
from ipalib.plugable import Registry
|
||||
from ipalib.text import _
|
||||
|
||||
@@ -196,7 +196,7 @@ class cert_remove_hold(MethodOverride):
|
||||
@register(override=True, no_fail=True)
|
||||
class cert_find(MethodOverride):
|
||||
takes_options = (
|
||||
File(
|
||||
BinaryFile(
|
||||
'file?',
|
||||
label=_("Input filename"),
|
||||
doc=_('File to load the certificate from.'),
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from ipaclient.frontend import MethodOverride
|
||||
from ipalib import errors, x509
|
||||
from ipalib.parameters import File
|
||||
from ipalib.parameters import BinaryFile
|
||||
from ipalib.plugable import Registry
|
||||
from ipalib.text import _
|
||||
|
||||
@@ -14,7 +14,7 @@ register = Registry()
|
||||
@register(override=True, no_fail=True)
|
||||
class certmap_match(MethodOverride):
|
||||
takes_args = (
|
||||
File(
|
||||
BinaryFile(
|
||||
'file?',
|
||||
label=_("Input file"),
|
||||
doc=_("File to load the certificate from"),
|
||||
|
||||
Reference in New Issue
Block a user