Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to disable MD5 check when uploading files to blob storage #262

Open
wleme opened this issue Apr 1, 2021 · 1 comment
Open

Comments

@wleme
Copy link

wleme commented Apr 1, 2021

Which service(blob, file) does this issue concern?

uploading to blob storage

Which version of the SDK was used?

2.0.1.0.1

On which platform were you using? (.Net Framework version or .Net Core version, and OS version)

.Net Framework 4.6.1

How can the problem be reproduced? It'd be better if the code caused the problem can be shared.

Just enable FIPS mode on your Windows and you won't be able to upload anything
await TransferManager.UploadAsync(filepath, blob, null, transferContext, cancellationSource.Token);

What problem was encountered?

When FIPS is enabled (at the OS level) the MD5 algorithm fails and no file is uploaded.

error message:
"This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()
at Microsoft.Azure.Storage.DataMovement.MD5Wrapper..ctor() in d:\repo\DM\azure-storage-net-data-movement\lib\MD5Wrapper.cs:line 40
at Microsoft.Azure.Storage.DataMovement.MD5HashStream..ctor(Stream stream, Int64 lastTransferOffset, Boolean md5hashCheck) in d:\repo\DM\azure-storage-net-data-movement\lib\MD5HashStream.cs:line 82
at Microsoft.Azure.Storage.DataMovement.TransferControllers.StreamedReader.d__19.MoveNext() in d:\repo\DM\azure-storage-net-data-movement\lib\TransferControllers\TransferReaders\StreamedReader.cs:line 263

Have you found a mitigation/solution?

The mitigation is disabling FIPS mode at the OS but some public sectors are required to have it enabled.

@MarcinKowal
Copy link

Hi @wleme, I found a workaround for that.
There is no way to disable MD5 on DMLib but this calculation is rather transparent to Azure storage SDK where MD5 is the only supported algorithm, used to ensure data integrity.
Good news is that you can force Azure SDK to use native implementation by setting

CloudStorageAccount.UseV1MD5
See documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants