[MIP SDK]Unable to open file using protection SDK 1.14

130 views Asked by At

We are consuming MIP SDK to view AIP protected files and showing sensitivity lable for Android and iOS application.

For this use case we are using protection sdk to decrypt file using protection handler class using below API.


int64_t decryptedSize = handler->DecryptBuffer(
                    0, // offsetFromStart
                    &content.encryptedData[0], //inputBuffer
                    static_cast<int64_t>(content.encryptedData.size()), //inputBufferSize
                    &outputBuffer[0],
                    static_cast<int64_t>(outputBuffer.size()),
                    true); //isFinal
            outputBuffer.resize(static_cast<size_t>(decryptedSize));

but we are now starting to failur to decrypt newly created files from Purview.

below is error that we are seeing in logs

AESCryptoWriter: Failed to transform final block

Although older AIP protected files are continue to open/save.

We Understood that 1.13 MIP SDK version and above support CBC encryption of Office files by default. so assumption that files encrypted using cbc will be decrypted without any change from 1.13 onwards by enabling the flag .But even after upgrading to 1.14 we are still seeing same error.

Please help for CBC encryption do we have to add anything additional in order to read AIP protected files in protection handler code ?

Note: Couldn't find any sample code from AIP Samples related to CBC.

1

There are 1 answers

1
Jay Zuo On

According to your description, you'd like to consume cipher block chaining (CBC) mode protected Office files. If so, you'd just use File SDK. There is no need to use Protection SDK. Refer from Version 1.13.158:

File SDK

  • Fixed issues with consuming cipher block chaining (CBC) mode protected Office files and emails. MIP SDK can now consume CBC mode protected content generated by Office.

Critical Update

MIP SDK 1.13 introduces support for consuming files and emails protected with AES256-CBC generated by Word, Excel, PowerPoint, Outlook, Exchange Online, SharePoint Online, and MIP SDK-enabled applications that opted in to CBC publishing. If your application uses the File SDK to consume any of these formats, it's important that you update the application to MIP SDK 1.13.