Skip to content

peer_id: rewrite parsing and error contracts#17

Merged
uink45 merged 1 commit intomainfrom
codex/rewrite-peer-id-module
Feb 15, 2026
Merged

peer_id: rewrite parsing and error contracts#17
uink45 merged 1 commit intomainfrom
codex/rewrite-peer-id-module

Conversation

@uink45
Copy link
Collaborator

@uink45 uink45 commented Feb 15, 2026

Summary

  • rewrote src/peer_id/peer_id.c into helper-driven, bounds-checked parsing/formatting paths for legacy base58 and CIDv1 peer IDs
  • aligned peer_id_to_string() with its documented contract by returning negative error codes on failure and deterministic output reset behavior
  • removed mutation of caller-owned private-key input buffers in RSA/Ed25519/ECDSA helper flows
  • replaced tests/peer_id/test_peer_id.c with vector-driven round-trip coverage plus explicit negative/boundary regression checks
  • added Step 3/7 standards mapping and remediation evidence in standards/rewrite-pilot-6-peer-id.md

Validation

  • cmake --build --preset macos-full --target peer_id peer_id_proto peer_id_rsa peer_id_ecdsa peer_id_ed25519 test_peer_id test_protocol_noise
  • ctest --preset macos-full -R '^(Testpeer_id|Testprotocol_noise)$' --output-on-failure
  • ctest --preset macos-full --output-on-failure
  • cmake --preset linux-asan-ubsan
  • cmake --build --preset linux-asan-ubsan --target test_peer_id test_protocol_noise
  • ctest --preset linux-asan-ubsan -R '^(Testpeer_id|Testprotocol_noise)$' --output-on-failure
  • ctest --preset linux-asan-ubsan --output-on-failure
  • clang-format --style=file --dry-run --Werror src/peer_id/peer_id.c src/peer_id/peer_id_rsa.c src/peer_id/peer_id_ecdsa.c src/peer_id/peer_id_ed25519.c tests/peer_id/test_peer_id.c
  • cppcheck --error-exitcode=1 --std=c99 --enable=warning,portability --quiet --suppress=missingIncludeSystem src/multiformats include/multiformats tests/multiformats src/peer_id include/peer_id tests/peer_id
  • scripts/dev/run-fast-lane-local.sh --platform macos

@uink45 uink45 merged commit 8bd1df8 into main Feb 15, 2026
3 checks passed
@uink45 uink45 deleted the codex/rewrite-peer-id-module branch February 15, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments