This commit is contained in:
Max Goedjen 2020-04-02 00:53:55 -07:00
parent f1e8e43f62
commit 5b38ef00c1
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8

View File

@ -49,8 +49,15 @@ class AgentTests: XCTestCase {
_ = inner.readNextChunk() _ = inner.readNextChunk()
let signedData = inner.readNextChunk() let signedData = inner.readNextChunk()
let rsData = OpenSSHReader(data: signedData) let rsData = OpenSSHReader(data: signedData)
let r = rsData.readNextChunk() var r = rsData.readNextChunk()
let s = rsData.readNextChunk() var s = rsData.readNextChunk()
// This is fine IRL, but it freaks out CryptoKit
if r[0] == 0 {
r.removeFirst()
}
if s[0] == 0 {
s.removeFirst()
}
var rs = r var rs = r
rs.append(s) rs.append(s)
let signature = try! P256.Signing.ECDSASignature(rawRepresentation: rs) let signature = try! P256.Signing.ECDSASignature(rawRepresentation: rs)