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

Make SHA256 the default HashAlgorithm. #54

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rpm/src/main/java/org/eclipse/packager/rpm/HashAlgorithm.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public String getId() {
* <p>
* This method will return the hash algorithm as specified by the
* parameter "name". If this parameter is {@code null} or an empty
* string, then the default algorithm {@link #SHA1} will be returned. If
* string, then the default algorithm {@link #SHA256} will be returned. If
* algorithm is an invalid name, then an exception is thrown.
* </p>
*
Expand All @@ -52,7 +52,7 @@ public String getId() {
*/
public static HashAlgorithm from(final String name) {
if (name == null || name.isEmpty()) {
return SHA1;
return SHA256;
}

return HashAlgorithm.valueOf(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public RsaHeaderSignatureProcessor(final PGPPrivateKey privateKey, final HashAlg
}

public RsaHeaderSignatureProcessor(final PGPPrivateKey privateKey) {
this(privateKey, HashAlgorithmTags.SHA1);
this(privateKey, HashAlgorithmTags.SHA256);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public RsaSignatureProcessor(final PGPPrivateKey privateKey, final HashAlgorithm
}

public RsaSignatureProcessor(final PGPPrivateKey privateKey) {
this(privateKey, HashAlgorithmTags.SHA1);
this(privateKey, HashAlgorithmTags.SHA256);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public Builder setSigning(final Function<OutputStream, OutputStream> signingStre
}

public Builder setSigning(final PGPPrivateKey privateKey) {
return setSigning(privateKey, HashAlgorithmTags.SHA1);
return setSigning(privateKey, HashAlgorithmTags.SHA256);
}

public Builder setSigning(final PGPPrivateKey privateKey, final HashAlgorithm hashAlgorithm) {
Expand Down