@@ -22,7 +22,6 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
22
22
using Microsoft . Azure . Storage . DataMovement ;
23
23
using Microsoft . Azure . Storage . File ;
24
24
using Microsoft . WindowsAzure . Commands . Common ;
25
- using Microsoft . WindowsAzure . Commands . Common . CustomAttributes ;
26
25
using Microsoft . WindowsAzure . Commands . Common . Storage . ResourceModel ;
27
26
using Microsoft . WindowsAzure . Commands . Storage . Common ;
28
27
using Microsoft . WindowsAzure . Commands . Utilities . Common ;
@@ -37,7 +36,6 @@ namespace Microsoft.WindowsAzure.Commands.Storage.File.Cmdlet
37
36
using System . Threading . Tasks ;
38
37
using LocalConstants = Microsoft . WindowsAzure . Commands . Storage . File . Constants ;
39
38
40
- [ CmdletOutputBreakingChangeWithVersion ( typeof ( AzureStorageFile ) , "14.0.0" , "9.0.0" , ChangeDescription = "The ContentHash properties will be removed from the uploaded Azure file when file size > 1TB, or upload with Oauth credencial, or with -DisAllowTrailingDot." ) ]
41
39
[ Cmdlet ( "Set" , Azure . Commands . ResourceManager . Common . AzureRMConstants . AzurePrefix + "StorageFileContent" , SupportsShouldProcess = true , DefaultParameterSetName = LocalConstants . ShareNameParameterSetName ) , OutputType ( typeof ( AzureStorageFile ) ) ]
42
40
public class SetAzureStorageFileContent : StorageFileDataManagementCmdletBase , IDynamicParameters
43
41
{
@@ -130,17 +128,9 @@ public override void ExecuteCmdlet()
130
128
}
131
129
long fileSize = localFile . Length ;
132
130
133
- // if FIPS policy is enabled, must use native MD5 for DMlib.
134
- if ( fipsEnabled )
131
+ if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
135
132
{
136
- if ( fileSize < sizeTB )
137
- {
138
- CloudStorageAccount . UseV1MD5 = false ;
139
- }
140
- else // use Track2 SDK
141
- {
142
- WriteWarning ( "The uploaded file won't have Content MD5 hash, since caculate MD5 hash fail, most possiblly caused by FIPS is enabled on this machine." ) ;
143
- }
133
+ CloudStorageAccount . UseV1MD5 = false ;
144
134
}
145
135
146
136
bool isDirectory ;
@@ -251,12 +241,6 @@ await fileClient.CreateAsync(fileSize,
251
241
252
242
List < Task > runningTasks = new List < Task > ( ) ;
253
243
254
- IncrementalHash hash = null ;
255
- if ( ! fipsEnabled )
256
- {
257
- hash = IncrementalHash . CreateHash ( HashAlgorithmName . MD5 ) ;
258
- }
259
-
260
244
using ( FileStream stream = File . OpenRead ( localFile . FullName ) )
261
245
{
262
246
byte [ ] buffer = null ;
@@ -268,10 +252,6 @@ await fileClient.CreateAsync(fileSize,
268
252
buffer = new byte [ targetBlockSize ] ;
269
253
270
254
int actualBlockSize = await stream . ReadAsync ( buffer : buffer , offset : 0 , count : ( int ) targetBlockSize ) ;
271
- if ( ! fipsEnabled && hash != null )
272
- {
273
- hash . AppendData ( buffer , 0 , actualBlockSize ) ;
274
- }
275
255
276
256
Task task = UploadFileRangAsync ( fileClient ,
277
257
new HttpRange ( offset , actualBlockSize ) ,
@@ -305,24 +285,6 @@ await fileClient.CreateAsync(fileSize,
305
285
await Task . WhenAll ( runningTasks ) . ConfigureAwait ( false ) ;
306
286
}
307
287
308
- // Need set file ContentHash
309
- if ( ( ! fipsEnabled && hash != null ) )
310
- {
311
- ShareFileHttpHeaders header = null ;
312
- if ( ! fipsEnabled && hash != null )
313
- {
314
- header = new ShareFileHttpHeaders ( ) ;
315
- header . ContentHash = hash . GetHashAndReset ( ) ;
316
- }
317
-
318
- // set file header and attributes to the file
319
- ShareFileSetHttpHeadersOptions httpHeadersOptions = new ShareFileSetHttpHeadersOptions
320
- {
321
- HttpHeaders = header ,
322
- } ;
323
- fileClient . SetHttpHeaders ( httpHeadersOptions ) ;
324
- }
325
-
326
288
if ( this . PassThru )
327
289
{
328
290
// TODO: should make sure track1 file object attributes get?
0 commit comments