providers/saml: fix signing_kp typo

This commit is contained in:
Jens Langhammer 2020-03-05 17:09:08 +01:00
parent 2c4dcb9cf0
commit f2119ce567
6 changed files with 22 additions and 6 deletions

View File

@ -24,7 +24,7 @@ class SAMLProviderSerializer(ModelSerializer):
"property_mappings", "property_mappings",
"digest_algorithm", "digest_algorithm",
"signature_algorithm", "signature_algorithm",
"singing_kp", "signing_kp",
] ]

View File

@ -33,7 +33,7 @@ class SAMLProviderForm(forms.ModelForm):
"property_mappings", "property_mappings",
"digest_algorithm", "digest_algorithm",
"signature_algorithm", "signature_algorithm",
"singing_kp", "signing_kp",
] ]
widgets = { widgets = {
"name": forms.TextInput(), "name": forms.TextInput(),

View File

@ -0,0 +1,16 @@
# Generated by Django 3.0.3 on 2020-03-05 16:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("passbook_providers_saml", "0007_auto_20200303_2157"),
]
operations = [
migrations.RenameField(
model_name="samlprovider", old_name="singing_kp", new_name="signing_kp",
),
]

View File

@ -75,7 +75,7 @@ class SAMLProvider(Provider):
default="rsa-sha256", default="rsa-sha256",
) )
singing_kp = models.ForeignKey( signing_kp = models.ForeignKey(
CertificateKeyPair, CertificateKeyPair,
default=None, default=None,
null=True, null=True,

View File

@ -33,10 +33,10 @@ def sign_with_signxml(data: str, provider: "SAMLProvider", reference_uri=None) -
signed = signer.sign( signed = signer.sign(
root, root,
key=key, key=key,
cert=[provider.singing_kp.certificate_data], cert=[provider.signing_kp.certificate_data],
reference_uri=reference_uri, reference_uri=reference_uri,
) )
XMLVerifier().verify(signed, x509_cert=provider.singing_kp.certificate_data) XMLVerifier().verify(signed, x509_cert=provider.signing_kp.certificate_data)
return etree.tostring(signed).decode("utf-8") # nosec return etree.tostring(signed).decode("utf-8") # nosec

View File

@ -275,7 +275,7 @@ class DescriptorDownloadView(AccessRequiredView):
) )
) )
pubkey = strip_pem_header( pubkey = strip_pem_header(
provider.singing_kp.certificate_data.replace("\r", "") provider.signing_kp.certificate_data.replace("\r", "")
).replace("\n", "") ).replace("\n", "")
subject_format = provider.processor.subject_format subject_format = provider.processor.subject_format
ctx = { ctx = {