Skip to content

Commit

Permalink
add explicit MD5 hash algo since it is no longer the Adobe default
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Feb 24, 2025
1 parent 27c8683 commit 7b84508
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test-harness/tests/specs/AmazonS3Spec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
it( "can get presigned URL for encrypted file with custom encrypted key", function(){
var data = "Hello, encrypted world!";
var key = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ), "MD5" ), "hex" ) );
s3.putObject(
bucketName = testBucket,
uri = "encrypted.txt",
Expand Down Expand Up @@ -825,7 +825,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
it( "can put encrypted with custom encryption key", function(){
var data = "Hello, encrypted world!";
var key = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ), "MD5" ), "hex" ) );
s3.putObject(
bucketName = testBucket,
uri = "encrypted.txt",
Expand Down Expand Up @@ -858,7 +858,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
);

var newKey = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( newKey ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( newKey ), "MD5" ), "hex" ) );

// Copy file with new encryption key
var o = s3.copyObject(
Expand Down Expand Up @@ -887,7 +887,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
it( "can rename encrypted file with custom encryption key", function(){
var data = "Hello, encrypted world!";
var key = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ), "MD5" ), "hex" ) );
// Store file with original encryption key
s3.putObject(
bucketName = testBucket,
Expand Down Expand Up @@ -922,7 +922,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
it( "can put encrypted with custom encryption key and custom algorithm", function(){
var data = "Hello, encrypted world!";
var key = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ), "MD5" ), "hex" ) );
s3.putObject(
bucketName = testBucket,
uri = "encrypted.txt",
Expand Down Expand Up @@ -1041,7 +1041,7 @@ component extends="coldbox.system.testing.BaseTestCase" {
it( "can use default encryption key", function(){
var data = "Hello, encrypted world!";
var key = generateSecretKey( "AES", 256 );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ) ), "hex" ) );
var keyMD5 = toBase64( binaryDecode( hash( toBinary( key ), "MD5" ), "hex" ) );
s3.setDefaultEncryptionKey( key );

s3.putObject(
Expand Down

0 comments on commit 7b84508

Please sign in to comment.