I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit ceba7f29 authored by zzz's avatar zzz
Browse files

Data: Ensure RouterIdent padding is compressed when read in

Did not affect most Destination creation code paths because they
are generally created via Destination.create(), not via readBytes(InputStream)

Add new more efficient method to indicate if padding was compressed
parent f1e95d96
No related branches found
No related tags found
No related merge requests found
......@@ -147,6 +147,14 @@ public class KeysAndCert extends DataStructureImpl {
_padding = padding;
compressPadding();
}
/**
* Is there compressible padding?
* @since 0.9.66
*/
public boolean isCompressible() {
return _paddingBlocks > 1;
}
/**
* @throws IllegalStateException if data already set
......@@ -165,6 +173,7 @@ public class KeysAndCert extends DataStructureImpl {
byte[] pad1 = pk.getPadding(kcert);
byte[] pad2 = spk.getPadding(kcert);
_padding = combinePadding(pad1, pad2);
compressPadding();
_certificate = kcert;
} else {
_publicKey = pk;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment