Skip to content

Commit 58ce717

Browse files
committed
change name function padTo32
1 parent c77546f commit 58ce717

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials/LoginTokenProvider.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ private fun parseECKeyPem(pem: String): ECKeyData {
259259
val remainingBytes = der.size - publicKeyStart
260260
val coordLen = remainingBytes / 2
261261

262-
val x = der.copyOfRange(publicKeyStart, publicKeyStart + coordLen).padTo32()
263-
val y = der.copyOfRange(publicKeyStart + coordLen, publicKeyStart + 2 * coordLen).padTo32()
262+
val x = der.copyOfRange(publicKeyStart, publicKeyStart + coordLen).padOrTrimTo32()
263+
val y = der.copyOfRange(publicKeyStart + coordLen, publicKeyStart + 2 * coordLen).padOrTrimTo32()
264264

265265
return ECKeyData(d, x, y)
266266
}
267267

268-
private fun ByteArray.padTo32(): ByteArray =
268+
private fun ByteArray.padOrTrimTo32(): ByteArray =
269269
if (size >= 32) {
270270
takeLast(32).toByteArray()
271271
} else {

0 commit comments

Comments
 (0)