Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: der2raw sLength is s byte length #634

Merged
merged 6 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions modules/integration-browser/src/testDecryptFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ export const bitFlippedDerTagsVectors = [
'f673bdf3-40a8-4551-bc7f-866b289e4d03', // Bit 3370 flipped
]

// The signatures on these messages fail to verify due to
// a known but yet to be fully diagnosed browser-specific issue.
// The error message is `Error: Invalid Signature`
export const unverifiableSignatureVectors = [
'2ad4430c-1b2e-46b3-a71d-a8e458f28a69',
'e3b4ce89-a5f4-4194-9bc5-2984cf1d2a88',
]

/*The contract for the two test*DecryptFixture methods:
* If the decryption is NOT supported,
* FAILED with err.message in notSupportedDecryptMessages
Expand Down Expand Up @@ -164,10 +156,7 @@ export function evaluateTestResultIgnoreUnsupported(
{ err, name, result }: TestVectorResult,
_expect: (x: any) => any
): void {
if (
bitFlippedDerTagsVectors.includes(name) ||
unverifiableSignatureVectors.includes(name)
) {
if (bitFlippedDerTagsVectors.includes(name)) {
return _expect(result).toEqual(false)
}
if (err && err['message']) {
Expand Down
2 changes: 1 addition & 1 deletion modules/serialize/src/ecdsa_signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function der2raw(
)

const rLength = r.byteLength()
const sLength = r.byteLength()
const sLength = s.byteLength()

return concatBuffers(
new Uint8Array(_keyLengthBytes - rLength),
Expand Down
Loading