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

Handling byte arrays through jackson serialisation #157

Merged
merged 3 commits into from
Dec 16, 2022

Conversation

therealryan
Copy link
Contributor

No description provided.

@@ -210,12 +213,21 @@
* @return The insert query message
*/
public static Query dbInsert( String key, String value ) {
byte[] hash;
try {
hash = MessageDigest.getInstance( "MD5" ).digest( value.getBytes( UTF_8 ) );

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm

Cryptographic algorithm [MD5](1) is weak and should not be used.
*/
public static byte[] md5( String text ) {
try {
return MessageDigest.getInstance( "MD5" ).digest( text.getBytes( UTF_8 ) );

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm

Cryptographic algorithm [MD5](1) is weak and should not be used.
LOG.info( "Storing '{}' to '{}'", data, key );
byte[] hash;
try {
hash = MessageDigest.getInstance( "MD5" ).digest( data.getBytes( UTF_8 ) );

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm

Cryptographic algorithm [MD5](1) is weak and should not be used.
String data = String.valueOf( m.get( "data" ) );
byte[] hash;
try {
hash = MessageDigest.getInstance( "MD5" ).digest( data.getBytes( UTF_8 ) );

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm

Cryptographic algorithm [MD5](1) is weak and should not be used.
@therealryan therealryan changed the title Handling byte arrays throw jackson serialisation Handling byte arrays through jackson serialisation Dec 16, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@therealryan therealryan merged commit 93dcf64 into main Dec 16, 2022
@therealryan therealryan deleted the sql_bytes_preserve branch December 16, 2022 08:47
@therealryan therealryan added the enhancement New feature or request label Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant