From 43a5f00f86940533f35c4a3d8b0fe8fe9b874d4b Mon Sep 17 00:00:00 2001 From: Victor Vrantchan Date: Tue, 10 Jul 2018 21:41:35 -0400 Subject: [PATCH] quickfix for ios 11.x --- pkcs7.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkcs7.go b/pkcs7.go index 2d46cd2..6395a82 100644 --- a/pkcs7.go +++ b/pkcs7.go @@ -365,7 +365,11 @@ func (p7 *PKCS7) EncryptionAlgorithm() (int, error) { switch { case alg.Equal(oidEncryptionAlgorithmDESCBC), alg.Equal(oidEncryptionAlgorithmDESEDE3CBC): return EncryptionAlgorithmDESCBC, nil - case alg.Equal(oidEncryptionAlgorithmAES256CBC), alg.Equal(oidEncryptionAlgorithmAES128GCM), alg.Equal(oidEncryptionAlgorithmAES128CBC): + case alg.Equal(oidEncryptionAlgorithmAES256CBC), alg.Equal(oidEncryptionAlgorithmAES128CBC): + // TODO: we fallback to DESCBC here because iOS and macOS is happy with that. + // a CBC variant should be implemented in https://github.com/groob/pkcs7/blob/9cd374b2a0fc58c461b5b28d6b147fde5027c91f/pkcs7.go#L964-L973 + return EncryptionAlgorithmDESCBC, nil + case alg.Equal(oidEncryptionAlgorithmAES128GCM): return EncryptionAlgorithmAES128GCM, nil default: return 0, ErrUnsupportedAlgorithm