|
| 1 | +# Vendored Oslo libraries |
| 2 | + |
| 3 | +This directory contains code vendored from the [Oslo |
| 4 | +project](https://oslojs.dev) by pilcrowOnPaper. The Oslo project is being |
| 5 | +deprecated, so the parts that the passkey component relies on live here |
| 6 | +instead of coming in as npm dependencies. |
| 7 | + |
| 8 | +All of the code is MIT-licensed, Copyright (c) 2024 pilcrowOnPaper (see the |
| 9 | +`LICENSE` file in this directory). |
| 10 | + |
| 11 | +## Sources |
| 12 | + |
| 13 | +Each directory mirrors one Oslo package, and the file layout follows the |
| 14 | +package's public import specifiers (for example `@oslojs/crypto/ecdsa` |
| 15 | +becomes `crypto/ecdsa.ts`). |
| 16 | + |
| 17 | +| Directory | Source package | Version | Commit | Repository | |
| 18 | +| ----------- | ------------------ | ------- | --------- | ---------------------------------------- | |
| 19 | +| `webauthn/` | `@oslojs/webauthn` | 1.0.0 | `c18f664` | https://github.com/oslo-project/webauthn | |
| 20 | +| `crypto/` | `@oslojs/crypto` | 1.0.1 | `8b3910f` | https://github.com/oslo-project/crypto | |
| 21 | +| `asn1/` | `@oslojs/asn1` | 1.0.0 | `65a9bbd` | https://github.com/oslo-project/asn1 | |
| 22 | +| `binary/` | `@oslojs/binary` | 1.0.0 | `9186bf7` | https://github.com/oslo-project/binary | |
| 23 | +| `cbor/` | `@oslojs/cbor` | 1.0.0 | `0ec853c` | https://github.com/oslo-project/cbor | |
| 24 | +| `encoding/` | `@oslojs/encoding` | 1.1.0 | `5b8b873` | https://github.com/oslo-project/encoding | |
| 25 | + |
| 26 | +## Modifications |
| 27 | + |
| 28 | +- Each package module is merged into a single file, and the pieces the |
| 29 | + passkey component does not use are removed (for example other hash |
| 30 | + functions, other elliptic curves, RSA-PSS, CBOR encoding, ASN.1 types that |
| 31 | + never appear in WebAuthn payloads, and the COSE key types the component |
| 32 | + rejects). |
| 33 | +- The tests are ported into `*.test.ts` files next to the sources so they run |
| 34 | + with the repository's Vitest setup. Tests that used `node:crypto` were |
| 35 | + rewritten against the WebCrypto API (the tests run in an edge-like runtime, |
| 36 | + like Convex functions). The NIST signature- and hash-verification vectors |
| 37 | + from the `@oslojs/crypto` repository are ported for the algorithms kept here |
| 38 | + (SHA-256, ECDSA P-256, RSASSA-PKCS1-v1.5) in `crypto/nist-vectors.test.ts`. |
| 39 | + |
| 40 | +When changing this code, keep the changes minimal and covered by the tests. |
0 commit comments