[Git][reproducible-builds/diffoscope][master] 2 commits: Rename the "Openssl" command class to "OpenSSLPKCS7" to accommodate other...

Chris Lamb gitlab at salsa.debian.org
Fri May 15 10:01:39 UTC 2020



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
b273af4a by Chris Lamb at 2020-05-15T10:51:46+01:00
Rename the "Openssl" command class to "OpenSSLPKCS7" to accommodate other command names with this prefix.

- - - - -
aa36c095 by Chris Lamb at 2020-05-15T10:51:46+01:00
Add support for Apple Xcode mobile provisioning .mobilepovision files. (Closes: reproducible-builds/diffoscope#113)

- - - - -


2 changed files:

- diffoscope/comparators/__init__.py
- diffoscope/comparators/openssl.py


Changes:

=====================================
diffoscope/comparators/__init__.py
=====================================
@@ -49,6 +49,7 @@ class ComparatorManager:
         ('json.JSONFile',),
         ('xml.XMLFile',),
         ('openssl.Pkcs7File',),
+        ('openssl.MobileProvisionFile',),
         ('text.TextFile',),
         ('bzip2.Bzip2File',),
         ('cpio.CpioFile',),


=====================================
diffoscope/comparators/openssl.py
=====================================
@@ -24,12 +24,29 @@ from .utils.file import File
 from .utils.command import Command
 
 
-class Openssl(Command):
+class OpenSSLPKCS7(Command):
     @tool_required('openssl')
     def cmdline(self):
         return ('openssl', 'pkcs7', '-print', '-noout', '-in', self.path)
 
 
+class OpenSSLSMIME(Command):
+    MASK_STDERR = True
+
+    @tool_required('openssl')
+    def cmdline(self):
+        return (
+            'openssl',
+            'smime',
+            '-inform',
+            'der',
+            '-verify',
+            '-noverify',
+            '-in',
+            self.path,
+        )
+
+
 class Pkcs7File(File):
     DESCRIPTION = "Public Key Cryptography Standards (PKCS) files (version #7)"
     FILE_TYPE_HEADER_PREFIX = b'-----BEGIN PKCS7-----'[:16]
@@ -37,6 +54,21 @@ class Pkcs7File(File):
     def compare_details(self, other, source=None):
         return [
             Difference.from_command(
-                Openssl, self.path, other.path, source='openssl pkcs7 -print'
+                OpenSSLPKCS7,
+                self.path,
+                other.path,
+                source='openssl pkcs7 -print',
+            )
+        ]
+
+
+class MobileProvisionFile(File):
+    DESCRIPTION = "Apple Xcode mobile provisioning files"
+    FILE_EXTENSION_SUFFIX = ".mobileprovision"
+
+    def compare_details(self, other, source=None):
+        return [
+            Difference.from_command(
+                OpenSSLSMIME, self.path, other.path, source='openssl smime'
             )
         ]



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/578d57459a880a0ac3466eba155ba7acc5d8633d...aa36c095775b3e077163f60d62863ae87ca12039

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/578d57459a880a0ac3466eba155ba7acc5d8633d...aa36c095775b3e077163f60d62863ae87ca12039
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20200515/86a397af/attachment.htm>


More information about the rb-commits mailing list