Commit Graph
11468 Commits
Author SHA1 Message Date
Sebastian Lorenz 8b4303bab5 Bracket IPv6 forward targets passed to ssh -W 2026-10-09 20:38:56 +00:00
Sebastian Lorenz 3c5077b60b Adapt SSH to the updated Crypto backend and HMAC key API 2026-10-09 20:38:56 +00:00
Sebastian Lorenz 4a8c37ea04 Remove SSH ai-docs and LLMS.md changes 2026-10-09 20:38:56 +00:00
Sebastian Lorenz f4dca042c0 Define SSH kex, packet, and signature operations as internal services
Kex, Packet, and Signatures are internal Context services built from Crypto.
The transport yields them; public constructors (SshClient.make,
SshClient.makeConnector, SshKey.make) provide their layers internally, so
public requirements stay Crypto only.
2026-10-09 20:38:56 +00:00
Sebastian Lorenz 9ff6b9dd93 Capture services once in SSH constructors instead of passing them as arguments
Internal kex, signatures, and packet modules now expose constructor effects
that read Crypto once and return closures; the transport, SshKeys,
SshKnownHosts, and OpenSsh factories build their helpers inside the
constructor after yielding their dependencies.
2026-10-09 20:38:56 +00:00
Sebastian Lorenz f7773661e7 Make Ssh a connection factory; connections are scoped values owned by userland 2026-10-09 20:38:56 +00:00
Sebastian Lorenz 212a33a3f6 Split SSH crypto internals into kex, signatures, packet, and errors modules 2026-10-09 20:38:56 +00:00
Sebastian Lorenz a408eb1da4 Capture Crypto once in SshKeys and SshKnownHosts services 2026-10-09 20:38:55 +00:00
Sebastian Lorenz 66e2933d96 Use Crypto key agreement and AES-CTR in SSH; remove WebCrypto shim 2026-10-09 20:38:55 +00:00
Sebastian Lorenz 58d45eb56b Define SSH services with the Context.Service class pattern 2026-10-09 20:38:55 +00:00
Sebastian Lorenz 8cb3577ed7 Provide Crypto to SSH tests with @effect/vitest layers 2026-10-09 20:38:55 +00:00
Sebastian Lorenz 6b4846a474 Use the Crypto service for SSH hashing, signatures, AES-GCM, and HMAC 2026-10-09 20:38:55 +00:00
Sebastian Lorenz f93f7e1c43 Add dependency-free SSH client, OpenSSH backend, SFTP, and remote ChildProcessSpawner 2026-10-09 20:38:55 +00:00
Tim Smart ec816aea4a Classify native Argon2 unavailability as Unsupported 2026-10-09 20:38:48 +00:00
Tim Smart 08f99f3570 Tighten Crypto comments and changeset wording 2026-10-09 20:38:48 +00:00
Tim Smart 7d400a9a97 Classify rejected key agreement data as InvalidData 2026-10-09 20:38:48 +00:00
Tim Smart ba3d81a3ad Assert the error tag for small-order X25519 peers
Native deriveBits rejects a small-order X25519 public key with an
OperationError on Node, Bun and Deno, which currently surfaces as Unknown.
A peer's invalid key is rejected input data, so expect InvalidData.
2026-10-09 20:38:48 +00:00
Tim Smart 87ba242f89 Validate Crypto options when an operation starts
make now takes a shallow copy of KDF, Argon2id, XChaCha, cipher, signing
and key-algorithm options when the effect runs, validates that copy, and
passes only the copy to the backend. A caller that changes its options
object afterwards can no longer alter a running derivation or bypass the
validated bounds, and changes made between building and running an effect
are validated too.
2026-10-09 20:38:48 +00:00
Tim Smart 172b1413da Cover KDF parameter ownership after an operation starts
Mutating a PBKDF2 options object's iteration count after the operation
starts must not change the result. This currently fails on every runtime
because the Web Crypto backend reads the count after its first await.
2026-10-09 20:38:48 +00:00
Tim Smart fa05398960 Migrate Crypto tests and cover HMAC verification and backend contract 2026-10-09 20:38:48 +00:00
Tim Smart 213313da84 Narrow the Crypto backend contract and add Unsupported errors
- make takes a named Crypto.Backend: randomBytes, optional subtle, and
  optional byte-level primitives. Key operations come only from subtle,
  since a Key only works with the backend that created it. An omitted or
  undefined subtle behave the same.
- Add an Unsupported SystemErrorTag for operations and algorithms a
  backend cannot perform, separate from BadArgument caller mistakes.
- Add hmacVerify, which compares HMACs in constant time.
- Drop the bit length from HMAC key algorithms; generated keys use the
  hash block size and imported keys their material length.
- Deno computes digests with node:crypto instead of building a second
  service for MD5.
- TestCrypto builds its random members with make and delegates the rest
  through a type-checked object.
2026-10-09 20:38:47 +00:00
Tim Smart d176c06326 Migrate Crypto tests and cover public API guarantees 2026-10-09 20:38:47 +00:00
Tim Smart 8e809d73e2 Refactor Crypto backends and option shapes
Crypto.make now takes an optional Web Crypto `subtle` backend plus optional
per-operation overrides, replacing the exported makeSubtle. Operations with
no backend fail with BadArgument, so make({ randomBytes, digest }) keeps
working and custom services are no longer broken.

- pbkdf2 and hkdf take options objects; HKDF salt and info default to empty.
- Remove rsaOaepEncrypt; importKey("spki") plus encrypt covers it.
- Rename HmacAlgorithm to HashAlgorithm.
- Failed authenticated decryption and malformed key data fail with a
  SystemError tagged InvalidData; unsupported algorithms, usages, and
  missing native support fail with BadArgument.
- Node keeps createHash/createHmac overrides and drops its PBKDF2 and
  RSA-OAEP overrides in favour of webcrypto.
2026-10-09 20:38:47 +00:00
Tim Smart 97b8107341 Reduce Crypto tests to focused contract coverage
Replace per-runtime copies of the RSA-OAEP, HMAC, and PBKDF2 tests with one
shared describeCrypto suite of published known-answer vectors, following the
node-shared *.test-utils.ts convention. Drop tests that mock SubtleCrypto
internals, inspect batching or freezing, or exercise the internal HChaCha20
helper, and keep one core regression test per random-sampling fix plus one
for make's argument validation.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz f31cb6b53c Validate crypto arguments before calling platform backends 2026-10-09 20:38:47 +00:00
Sebastian Lorenz a8257a32de Batch random shuffle draws in Crypto 2026-10-09 20:38:47 +00:00
Sebastian Lorenz df9c3c0796 Buffer small random-byte requests in the Node crypto service
Each native random fill costs about as much for 4 KiB as for 7 bytes, so
serving per-draw requests from a reusable buffer makes randomShuffle about
15x faster on Node and 3x on Bun. Requests return fresh copies, consumed
bytes are zeroed, and the buffer is discarded before a V8 startup snapshot
is serialized so snapshot-started processes never share random bytes.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz a7af335c42 Add ECDH/X25519 key agreement and AES-CTR to Crypto
Add deriveSharedSecret for full-length ECDH and X25519 shared secrets,
rejecting mismatched keys and all-zero X25519 output (RFC 7748). Add
AES-CTR secret keys and cipher options, deriveBits key usage, and raw
import/export of ECDSA, ECDH, Ed25519, and X25519 public keys. Key usages
are now reported in a canonical order across backends.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz 4f5902333a Address Crypto review findings
Default importJwk usages to the JWK key_ops, bound PBKDF2 iterations and
length to Web Crypto's 32-bit limits, sample narrow integer ranges without
BigInt, report a missing SubtleCrypto backend explicitly, reuse shared
digest paths in Deno, and avoid leaving XChaCha plaintext in the Buffer pool.
2026-10-09 20:38:46 +00:00
Sebastian Lorenz 58deab486e Fix JSDoc section headings for Crypto UUID generators 2026-10-09 20:38:46 +00:00
Sebastian Lorenz 07ed4ec25f Release cryptography additions as a patch update 2026-10-09 20:38:46 +00:00
Sebastian Lorenz ab0b38e3ab Align Crypto expansion with stability tags, TestCrypto, and UUID formats 2026-10-09 20:38:46 +00:00
Michael Arnaldi d2e0cd0506 Add HKDF, Argon2id, XChaCha20-Poly1305, and JWK support 2026-10-09 20:38:46 +00:00
Michael Arnaldi a1a99a2b15 Expand Crypto with encryption, signing, and key management 2026-10-09 20:38:46 +00:00
Michael Arnaldi 7bcad0dfc7 Release cryptography additions as a minor update 2026-10-09 20:38:46 +00:00
Michael Arnaldi 4f1bfdab29 Require HMAC, PBKDF2, and RSA-OAEP in Crypto implementations 2026-10-09 20:38:45 +00:00
Michael Arnaldi 289e3da737 Fix binary OAEP label verification under Deno 2026-10-09 20:38:45 +00:00
Michael Arnaldi d60f8e23a0 Add portable HMAC, PBKDF2, and RSA-OAEP cryptography primitives 2026-10-09 20:38:45 +00:00
Stéphane Le DorzeandEffect Bot 4b1f4aa8ad Add an explicit maxDepth option to Context.makeUnsafe (#8969)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-10-09 20:33:29 +00:00
1db5671d77 fix(ai-anthropic): decode replies a fallback model took over (#8971)
Co-authored-by: Mathieu Post <5338582+m9tdev@users.noreply.github.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-10 09:27:39 +13:00
76a03f7599 Fix Duration.times throwing for non-integer multipliers of nanosecond durations (#8972)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-10 09:14:30 +13:00
e052f1b30b Avoid copying the Context rebase map twice (#8968)
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-10 09:10:35 +13:00
effect-bot f7c4317345 Test DateTime.toDate wall-clock conversion for zoned values (#8975) 2026-10-10 08:19:34 +13:00
Sebastian Lorenz 9dbd07e006 Accept address and name server inputs in the Dns services (#8973) 2026-10-09 18:29:30 +00:00
Sebastian Lorenz e7d84e449a Add fromInput functions to the net data types (#8970) 2026-10-09 17:41:46 +00:00
66257d2922 Hand cluster shards off one at a time on shutdown (#8941)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-09 11:18:57 +00:00
effect-bot f54c34a754 Restore lease-based SQL shard lock renewal (#8965) 2026-10-09 11:18:38 +00:00
Tim bfc5742e18 Record RPC response-encoding failures on the server span (#8958) 2026-10-10 00:12:56 +13:00
Tim aef1d1f2e5 Add cluster RPC interrupt-on-termination annotation (#8963) 2026-10-09 10:44:12 +00:00
effect-bot 210fd06398 Keep shard locks held while their runner shuts down (#8961) 2026-10-09 10:20:54 +00:00