Skip to content

Commit a6a2a78

Browse files
committed
ktlint
1 parent 00b62ee commit a6a2a78

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

runtime/auth/aws-signing-default/common/src/aws/smithy/kotlin/runtime/auth/awssigning/SignatureCalculator.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ internal abstract class SigV4xSignatureCalculator(
7979
open val sha256Provider: HashSupplier = ::Sha256,
8080
) : SignatureCalculator {
8181
init {
82-
check (algorithm == AwsSigningAlgorithm.SIGV4 || algorithm == AwsSigningAlgorithm.SIGV4_ASYMMETRIC) {
82+
check(algorithm == AwsSigningAlgorithm.SIGV4 || algorithm == AwsSigningAlgorithm.SIGV4_ASYMMETRIC) {
8383
"This class should only be used for the ${AwsSigningAlgorithm.SIGV4} or ${AwsSigningAlgorithm.SIGV4_ASYMMETRIC} algorithms, got $algorithm"
8484
}
8585
}
@@ -122,7 +122,6 @@ internal val AwsSigningAlgorithm.signingName: String
122122
AwsSigningAlgorithm.SIGV4_ASYMMETRIC -> "AWS4-ECDSA-P256-SHA256"
123123
}
124124

125-
126125
internal class SigV4SignatureCalculator(override val sha256Provider: HashSupplier = ::Sha256) : SigV4xSignatureCalculator(AwsSigningAlgorithm.SIGV4, sha256Provider) {
127126
override fun calculate(signingKey: ByteArray, stringToSign: String): String =
128127
hmac(signingKey, stringToSign.encodeToByteArray(), sha256Provider).encodeToHex()
@@ -185,12 +184,11 @@ internal class SigV4aSignatureCalculator(override val sha256Provider: HashSuppli
185184
*/
186185
private fun fixedInputString(accessKeyId: String, counter: Byte): ByteArray =
187186
byteArrayOf(0x00, 0x00, 0x00, 0x01) + // FIXME CRT implementation (4 bytes) and internal docs (1 byte) conflict.
188-
"AWS4-ECDSA-P256-SHA256".encodeToByteArray() +
189-
byteArrayOf(0x00) +
190-
accessKeyId.encodeToByteArray() +
191-
counter +
192-
byteArrayOf(0x00, 0x00, 0x01, 0x00) // FIXME CRT implementation (4 bytes) and internal docs (2 bytes) conflict.
193-
187+
"AWS4-ECDSA-P256-SHA256".encodeToByteArray() +
188+
byteArrayOf(0x00) +
189+
accessKeyId.encodeToByteArray() +
190+
counter +
191+
byteArrayOf(0x00, 0x00, 0x01, 0x00) // FIXME CRT implementation (4 bytes) and internal docs (2 bytes) conflict.
194192
}
195193

196194
private const val HEADER_TIMESTAMP_TYPE: Byte = 8

0 commit comments

Comments
 (0)