We have an issue with the current way the MD5 sum is calculated in the "Generate Security Hash Assertion"
Generate Security Hash Assertion (broadcom.com)
For our automation, we need to programmatically generate md5sums via bash script which would match the md5sum in some assertion. Our requirement is that it would match the simple md5sum function available on any Linux distribution:
Expected:
$ echo "fred" | md5sum
08b622ddf7eb7c8e44cdb3bd6362f966 -
Actual:
Source data: ${var}
Value of context variable named "var": a String type: "fred"
Input characters: 4 characters: { f, r, e, d }
Chars converted to bytes using UTF-8: 4 bytes: { 66, 72, 65, 64 }
MD5 hash of these 4 bytes: 16 bytes: { 57, 0a, 90, bf, bf, 8c, 7e, ab, 5d, c5, d4, e2, 68, 32, d5, b1 }
Base-64 encoding of MD5 hash 16 bytes: "VwqQv7+MfqtdxdTiaDLVsQ=="
All supported API gateways
Base-64 encoding of MD5 hash 16 bytes: "VwqQv7+MfqtdxdTiaDLVsQ=="
$ echo -n "fred" | md5sum | base64