Skip to content

Commit

Permalink
* ignore whitespaces so you can copy&paste signatures better
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5828 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
f1ori committed Apr 17, 2009
1 parent fadf311 commit d93a2a6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -730,7 +730,7 @@ public void overwriteNetworkDefinition() {
try {
String publicKeyString = getConfig("network.unit.update.location" + i + ".key", null);
if(publicKeyString != null) {
byte[] publicKeyBytes = Base64Order.standardCoder.decode(publicKeyString, "decode public Key");
byte[] publicKeyBytes = Base64Order.standardCoder.decode(publicKeyString.trim(), "decode public Key");
publicKey = cryptoLib.getPublicKeyFromBytes(publicKeyBytes);
}
} catch (InvalidKeySpecException e) {
Expand Down
4 changes: 2 additions & 2 deletions source/de/anomic/tools/CryptoLib.java
Expand Up @@ -155,14 +155,14 @@ public static void main(String[] args) {
CryptoLib cl = new CryptoLib();
serverCharBuffer pubKeyBuffer = new serverCharBuffer(new File(args[1]));
byte[] pubKeyByteBuffer = Base64Order.standardCoder.decode(
pubKeyBuffer.toString(), "Private Key");
pubKeyBuffer.toString().trim(), "Private Key");
PublicKey pubKey = cl.getPublicKeyFromBytes(pubKeyByteBuffer);

FileInputStream dataStream = new FileInputStream(args[2]);

serverCharBuffer signBuffer = new serverCharBuffer(new File(args[2] + ".sig"));
byte[] signByteBuffer = Base64Order.standardCoder.decode(
signBuffer.toString(), "Signature");
signBuffer.toString().trim(), "Signature");
if(cl.verifySignature(pubKey, dataStream, signByteBuffer)) {
System.out.println("Signature OK!");
} else {
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/yacy/yacyVersion.java
Expand Up @@ -394,7 +394,7 @@ public File downloadRelease() {
return null;
}
try {
signatureBytes = Base64Order.standardCoder.decode(new String(signatureData, "UTF8"), "decode signature");
signatureBytes = Base64Order.standardCoder.decode(new String(signatureData, "UTF8").trim(), "decode signature");
} catch (UnsupportedEncodingException e) {
Log.logSevere("yacyVersion", "download of signature " + this.url.toString() + " failed: unsupported encoding");
return null;
Expand Down

0 comments on commit d93a2a6

Please sign in to comment.