Skip to content

Commit 488f433

Browse files
denunosdorra
authored andcommitted
appears to fix issue craigwblake#62 keys with bigger RSA headers fail
1 parent 47b2a5d commit 488f433

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

src/main/java/org/redline_rpm/SignatureGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
public class SignatureGenerator {
3333

34-
protected static final int SIGNATURE_SIZE = 287;
34+
protected static final int SIGNATURE_SIZE = 543;
3535
protected final boolean enabled;
3636
protected Entry< byte[]> headerOnlyRSAEntry;
3737
protected Entry< byte[]> headerAndPayloadPGPEntry;

src/test/java/org/redline_rpm/ant/RedlineTaskTest.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,23 @@ public void testSigning() throws Exception {
423423
assertNotNull( format.getSignature().getEntry( LEGACY_PGP));
424424
}
425425

426+
@Test
427+
public void testSigningBiggerRSAHeader() throws Exception {
428+
429+
File dir = ensureTargetDir();
430+
431+
File filename = new File(dir, "rpmtest-1.0-1.noarch.rpm");
432+
433+
RedlineTask task = createBasicTask( dir);
434+
task.setPrivateKeyRingFile( new File( getFileResource( "/pgp/secringBiggerRSAHeader.gpg")));
435+
task.setPrivateKeyPassphrase( "test");
436+
task.execute();
437+
438+
Format format = getFormat( filename);
439+
assertNotNull( format.getSignature().getEntry( RSAHEADER));
440+
assertNotNull( format.getSignature().getEntry( LEGACY_PGP));
441+
}
442+
426443
private Format getFormat( File filename ) throws IOException {
427444
Scanner scanner = new Scanner();
428445
return scanner.run(new ReadableChannelWrapper( Channels
Binary file not shown.

0 commit comments

Comments
 (0)