diff --git a/CHANGES.rst b/CHANGES.rst index 360f828ab0..d2b2e0b879 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -8,7 +8,7 @@ Changes to be released in next version * 🐛 Bugfix - * + * Remove padding from base64 encoded `iv` value (vector-im/element-ios/issues/4172). ⚠️ API Changes * diff --git a/MatrixSDK/Crypto/Data/MXEncryptedAttachments.m b/MatrixSDK/Crypto/Data/MXEncryptedAttachments.m index 3c74aae337..c7c0fe658f 100644 --- a/MatrixSDK/Crypto/Data/MXEncryptedAttachments.m +++ b/MatrixSDK/Crypto/Data/MXEncryptedAttachments.m @@ -170,7 +170,7 @@ + (void)encryptAttachment:(MXMediaLoader *)uploader encryptedContentFile.url = url; encryptedContentFile.mimetype = mimeType; encryptedContentFile.key = encryptedContentKey; - encryptedContentFile.iv = [iv base64EncodedStringWithOptions:0]; + encryptedContentFile.iv = [MXBase64Tools base64ToUnpaddedBase64:[iv base64EncodedStringWithOptions:0]]; encryptedContentFile.hashes = @{ @"sha256": [MXBase64Tools base64ToUnpaddedBase64:[computedSha256 base64EncodedStringWithOptions:0]], };