[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Change hex strings back to lower-case.



commit 1960762ca3ad515a22b90fdd3a1f4c68a3fa9588
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Aug 13 20:47:09 2015 +0200

    Change hex strings back to lower-case.
    
    Bugfix on 1734d16 where we started using Java's DatatypeConverter
    class which defaults to upper-case, rather than Apache Commons Codec
    which returns lower-case strings.
---
 src/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java |    3 ++-
 src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java     |    3 ++-
 src/org/torproject/descriptor/impl/MicrodescriptorImpl.java         |    3 ++-
 src/org/torproject/descriptor/impl/RelayDirectoryImpl.java          |    3 ++-
 .../torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java |    3 ++-
 src/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java      |    3 ++-
 src/org/torproject/descriptor/impl/ServerDescriptorImpl.java        |    3 ++-
 7 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java b/src/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
index 151c384..4a2f39c 100644
--- a/src/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
+++ b/src/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
@@ -207,7 +207,8 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.certificateDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index ba7b6b6..b26a593 100644
--- a/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -656,7 +656,8 @@ public class ExtraInfoDescriptorImpl extends DescriptorImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.extraInfoDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/MicrodescriptorImpl.java b/src/org/torproject/descriptor/impl/MicrodescriptorImpl.java
index 3d83923..ffa5a0f 100644
--- a/src/org/torproject/descriptor/impl/MicrodescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/MicrodescriptorImpl.java
@@ -207,7 +207,8 @@ public class MicrodescriptorImpl extends DescriptorImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, end - start);
         this.microdescriptorDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-256").digest(forDigest));
+            MessageDigest.getInstance("SHA-256").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/RelayDirectoryImpl.java b/src/org/torproject/descriptor/impl/RelayDirectoryImpl.java
index d88997e..e5977c0 100644
--- a/src/org/torproject/descriptor/impl/RelayDirectoryImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayDirectoryImpl.java
@@ -74,7 +74,8 @@ public class RelayDirectoryImpl extends DescriptorImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.directoryDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
index 849124e..0b3c53a 100644
--- a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
@@ -74,7 +74,8 @@ public class RelayNetworkStatusConsensusImpl extends NetworkStatusImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.consensusDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
index 06cca61..6faeee0 100644
--- a/src/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
@@ -72,7 +72,8 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.statusDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */
diff --git a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
index 6070ef4..3962ea1 100644
--- a/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
+++ b/src/org/torproject/descriptor/impl/ServerDescriptorImpl.java
@@ -542,7 +542,8 @@ public class ServerDescriptorImpl extends DescriptorImpl
         System.arraycopy(this.getRawDescriptorBytes(), start,
             forDigest, 0, sig - start);
         this.serverDescriptorDigest = DatatypeConverter.printHexBinary(
-            MessageDigest.getInstance("SHA-1").digest(forDigest));
+            MessageDigest.getInstance("SHA-1").digest(forDigest)).
+            toLowerCase();
       }
     } catch (UnsupportedEncodingException e) {
       /* Handle below. */

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits