1.1 --- a/MoinMessage.py Fri Jun 07 18:41:04 2013 +0200
1.2 +++ b/MoinMessage.py Sat Jun 08 01:21:27 2013 +0200
1.3 @@ -282,10 +282,7 @@
1.4 (fingerprint, identity, content).
1.5 """
1.6
1.7 - try:
1.8 - content, signature = message.get_payload()
1.9 - except ValueError:
1.10 - raise MoinMessageMissingPart
1.11 + content, signature = getContentAndSignature(message)
1.12
1.13 # Verify the message format.
1.14
1.15 @@ -386,6 +383,23 @@
1.16 return mimetype == "multipart/encrypted" and \
1.17 message.get_param("protocol") == "application/pgp-encrypted"
1.18
1.19 +def getContentAndSignature(message):
1.20 +
1.21 + """
1.22 + Return the content and signature parts of the given RFC 3156 'message'.
1.23 +
1.24 + NOTE: RFC 3156 states that signed messages should employ a detached
1.25 + NOTE: signature but then shows "BEGIN PGP MESSAGE" for signatures
1.26 + NOTE: instead of "BEGIN PGP SIGNATURE".
1.27 + NOTE: The "micalg" parameter is currently not supported.
1.28 + """
1.29 +
1.30 + try:
1.31 + content, signature = message.get_payload()
1.32 + return content, signature
1.33 + except ValueError:
1.34 + raise MoinMessageMissingPart
1.35 +
1.36 # Communications functions.
1.37
1.38 def timestamp(message):