X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=userdir_gpg.py;h=d89b78eaa8caef834251359cca13929026afb8fc;hb=f8181b0dfa59390433a8329e61f0cfbc2f720644;hp=b84a76d8fda2524aecac95d283a4caae2449e330;hpb=b00b7eec003232f689b194f8d2ab7d03c74cc78d;p=mirror%2Fuserdir-ldap.git diff --git a/userdir_gpg.py b/userdir_gpg.py index b84a76d..d89b78e 100644 --- a/userdir_gpg.py +++ b/userdir_gpg.py @@ -108,10 +108,10 @@ def GetClearSig(Msg, Paranoid = 0, lax_multipart = False): (Signed, Signature) = payloads - if Signed.get_content_type() != "text/plain": - raise UDFormatError, "Invalid pgp/mime encoding [wrong plaintext type]"; + if Signed.get_content_type() != "text/plain" and not lax_multipart: + raise UDFormatError, "Invalid pgp/mime encoding for first part[wrong plaintext type]"; if Signature.get_content_type() != "application/pgp-signature": - raise UDFormatError, "Invalid pgp/mime encoding [wrong signature type]"; + raise UDFormatError, "Invalid pgp/mime encoding for second part [wrong signature type]"; # Append the PGP boundary header and the signature text to re-form the # original signed block [needs to convert to \r\n]