Skip to content

Commit 7d632f9

Browse files
authored
Merge pull request #177 from iot-dsa-v2/develop
0.73.2
2 parents 0995e87 + e0a805b commit 7d632f9

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ subprojects {
55
apply plugin: 'maven'
66

77
group 'org.iot-dsa'
8-
version '0.73.1'
8+
version '0.73.2'
99

1010
targetCompatibility = JavaVersion.VERSION_1_8
1111
sourceCompatibility = JavaVersion.VERSION_1_8

dslink-v2-api/src/main/java/org/iot/dsa/node/DSStatus.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@
4343
public class DSStatus extends DSValue implements DSIStatus, DSIStorable {
4444

4545
///////////////////////////////////////////////////////////////////////////
46-
// Constants
46+
// Class Fields
4747
///////////////////////////////////////////////////////////////////////////
4848

4949
private static final int UNCERTAIN_MASK = 0x0000FF00;
5050
private static final int BAD_MASK = 0x00FF0000;
5151
private static final int HIS_MASK = 0xFF000000; //for history flags
5252
private static final int NOT_GOOD_MASK = 0x00FFFF00;
53+
5354
/**
5455
* Good, no other status applies. Always implied when not present.
5556
*/
@@ -155,11 +156,13 @@ public class DSStatus extends DSValue implements DSIStatus, DSIStorable {
155156
public static final DSStatus remoteUnknown = valueOf(REMOTE_UNKNOWN);
156157
public static final DSStatus start = valueOf(START);
157158

158-
///////////////////////////////////////////////////////////////////////////
159-
// Fields
160-
///////////////////////////////////////////////////////////////////////////
161159
private static ConcurrentHashMap<String, Integer> stringCache =
162160
new ConcurrentHashMap<>();
161+
162+
///////////////////////////////////////////////////////////////////////////
163+
// Instance Fields
164+
///////////////////////////////////////////////////////////////////////////
165+
163166
private int bits;
164167

165168
///////////////////////////////////////////////////////////////////////////

dslink-v2-api/src/main/java/org/iot/dsa/security/DSKeys.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static DSKeys decodeKeys(String arg) {
9797
*/
9898
public static ECPrivateKey decodePrivate(byte[] bytes) {
9999
try {
100-
BigInteger s = new BigInteger(bytes);
100+
BigInteger s = new BigInteger(1, bytes);
101101
ECPrivateKeySpec spec = new ECPrivateKeySpec(s, getParameters());
102102
KeyFactory fac = KeyFactory.getInstance("EC");
103103
return (ECPrivateKey) fac.generatePrivate(spec);
@@ -115,8 +115,8 @@ public static ECPublicKey decodePublic(byte[] bytes) {
115115
if (bytes[0] != 0x04) {
116116
throw new IllegalArgumentException("Invalid public key");
117117
}
118-
BigInteger x = new BigInteger(Arrays.copyOfRange(bytes, 1, 33));
119-
BigInteger y = new BigInteger(Arrays.copyOfRange(bytes, 33, 65));
118+
BigInteger x = new BigInteger(1, Arrays.copyOfRange(bytes, 1, 33));
119+
BigInteger y = new BigInteger(1, Arrays.copyOfRange(bytes, 33, 65));
120120
ECPoint point = new ECPoint(x, y);
121121
ECPublicKeySpec spec = new ECPublicKeySpec(point, getParameters());
122122
KeyFactory fac = KeyFactory.getInstance("EC");

0 commit comments

Comments
 (0)