crypto: fix import_certificate checking private key as certificate

closes #3713

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-10-02 00:31:14 +02:00
parent eccbf08cd8
commit 93e90f8f50
1 changed files with 2 additions and 2 deletions

View File

@ -38,9 +38,9 @@ class Command(BaseCommand):
try: try:
serializer.validate_certificate_data(keypair.certificate_data) serializer.validate_certificate_data(keypair.certificate_data)
if keypair.key_data != "": if keypair.key_data != "":
serializer.validate_certificate_data(keypair.key_data) serializer.validate_key_data(keypair.key_data)
except ValidationError as exc: except ValidationError as exc:
self.stderr.write(exc) self.stderr.write(str(exc))
sys_exit(1) sys_exit(1)
if dirty: if dirty:
keypair.save() keypair.save()