Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from jenkinsci/SHA256-and-SHA512-HMAC-support
[JENKINS-33021] Add support for SHA256 and SHA512 HMAC algorithms
- Loading branch information
Showing
14 changed files
with
321 additions
and
125 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
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
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
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
47 changes: 47 additions & 0 deletions
47
src/com/trilead/ssh2/crypto/digest/JreMessageDigestWrapper.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,47 @@ | ||
package com.trilead.ssh2.crypto.digest; | ||
|
||
import java.security.MessageDigest; | ||
|
||
/** | ||
* @author Michael Clarke | ||
*/ | ||
public class JreMessageDigestWrapper implements Digest { | ||
|
||
private final MessageDigest digest; | ||
|
||
public JreMessageDigestWrapper(MessageDigest digest) { | ||
super(); | ||
this.digest = digest; | ||
} | ||
|
||
public int getDigestLength() { | ||
return digest.getDigestLength(); | ||
} | ||
|
||
public void update(byte b) { | ||
digest.update(b); | ||
} | ||
|
||
public void update(byte[] b) { | ||
digest.update(b); | ||
} | ||
|
||
public void update(byte[] b, int off, int len) { | ||
digest.update(b, off, len); | ||
} | ||
|
||
public void reset() { | ||
digest.reset(); | ||
} | ||
|
||
public void digest(byte[] out) { | ||
byte[] output = digest.digest(); | ||
System.arraycopy(output, 0, out, 0, out.length); | ||
} | ||
|
||
public void digest(byte[] out, int off) { | ||
byte[] output = digest.digest(); | ||
System.arraycopy(output, 0, out, off, out.length); | ||
|
||
} | ||
} |
Oops, something went wrong.