-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add builder for vulnerability types and fix insecure auth protocol
- Loading branch information
1 parent
ae0ed76
commit 4ee55ca
Showing
6 changed files
with
195 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
dd-java-agent/agent-iast/src/main/java/com/datadog/iast/util/CRCUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.datadog.iast.util; | ||
|
||
import java.nio.charset.Charset; | ||
import java.nio.charset.StandardCharsets; | ||
import java.util.zip.CRC32; | ||
|
||
public abstract class CRCUtils { | ||
|
||
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; | ||
|
||
private CRCUtils() {} | ||
|
||
public static void update(final CRC32 crc, final String value) { | ||
update(crc, value, DEFAULT_CHARSET); | ||
} | ||
|
||
public static void update(final CRC32 crc, final String value, final Charset charset) { | ||
final byte[] bytes = value.getBytes(charset); | ||
update(crc, bytes); | ||
} | ||
|
||
public static void update(final CRC32 crc, final byte[] bytes) { | ||
crc.update(bytes, 0, bytes.length); | ||
} | ||
} |
Oops, something went wrong.