File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/auth/credentials Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments