You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: runtime/auth/aws-signing-default/common/src/aws/smithy/kotlin/runtime/auth/awssigning/SigV4aSignatureCalculator.kt
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ internal class SigV4aSignatureCalculator(override val sha256Provider: HashSuppli
27
27
var privateKey:ByteArray
28
28
29
29
// N value from NIST P-256 curve, minus two.
30
-
val nMinusTwo =BigInteger("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC63254F".decodeHexBytes())
30
+
val nMinusTwo ="FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC63254F".decodeHexBytes().toPositiveBigInteger()
31
31
32
32
// FIXME Public docs say secret access key needs to be Base64 encoded, that's not right.
33
33
// (or maybe it's already base64-encoded, and they are just repeating it)
@@ -38,7 +38,7 @@ internal class SigV4aSignatureCalculator(override val sha256Provider: HashSuppli
38
38
val k0 = hmac(inputKey, fixedInputString(config.credentials.accessKeyId, counter), sha256Provider)
39
39
40
40
// 2: Compute the ECC key pair
41
-
val c =BigInteger(k0)
41
+
val c =k0.toPositiveBigInteger()
42
42
43
43
privateKey = (c +BigInteger("1")).toByteArray()
44
44
@@ -64,4 +64,13 @@ internal class SigV4aSignatureCalculator(override val sha256Provider: HashSuppli
0 commit comments