-
Notifications
You must be signed in to change notification settings - Fork 0
Whiteflagupdate2025 #77
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
Open
CorruptedAesthetic
wants to merge
18
commits into
main
Choose a base branch
from
whiteflagupdate2025
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tion Method 1 - Add hybrid sr25519/ECDSA cryptographic signer with deterministic key derivation - Implement RFC 7515 compliant JSON Web Signature (JWS) with ES256 algorithm - Create Whiteflag Protocol Method 1 JWT authentication tokens with proper claims - Add comprehensive test suite (32 tests) covering functionality and security - Include examples demonstrating API integration and Node.js compatibility - Support JWKS generation for public key distribution - Maintain full compatibility with Substrate sr25519 keys and Whiteflag Protocol v1.0
- Modernize GitHub Actions workflow with proper YAML syntax - Update to ubuntu-latest and actions@v4 - Add proper Rust toolchain setup with dtolnay/rust-toolchain - Fix branches array syntax for workflow triggers - Apply cargo fmt formatting to all code files - Add clippy linting with warning enforcement - All tests passing (32 total across wf_auth and main project)
- Remove unnecessary cast in wf_common/src/common.rs - Fix lifetime syntax in wf_crypto/src/wf_encryption_key.rs - Replace ToString with Display implementation in wf_field/src/types.rs - Fix redundant field names in wf_field/src/message_header.rs - Update format strings to use inline variables throughout codebase - Fix manual ok() implementation in wf_parser/src/header.rs - Remove needless match expressions and question mark operators - Add allow(dead_code) for unused struct fields All 143 tests passing, clippy warnings resolved.
- Apply rustfmt formatting to wf_field/src/request.rs - Ensures CI/CD pipeline passes formatting checks
- Update JwtHeader::default() to use 'sr25519' instead of 'ES256' - Update JWS creation to use sr25519 signing instead of ECDSA - Update JWK Set creation to use sr25519 public key format - Update all tests to expect sr25519 algorithm - Update examples and documentation to reflect sr25519 usage - Maintain backward compatibility with existing functionality This change aligns with Polkadot/Substrate blockchain compatibility as suggested in the evaluation document.
- Fix clippy warning about needless borrows for generic args - Change Sha256::digest(&public_key_bytes) to Sha256::digest(public_key_bytes)
- Add bounds checking to prevent index out of bounds panic - Return descriptive error message instead of crashing - Fixes WhiteFlag encoding failures in production
The JSON deserializer was assigning pseudoMessageCode index 14, which came after text (index 11), authentication, crypto, and resource fields. This caused the field values array to be sorted incorrectly for Test messages. According to WhiteFlag spec section 4.3.6 and 5.5: - Test messages have header fields (bytes 0-70) - Followed by pseudoMessageCode (byte 71) - Then body fields from the original message type (byte 72+) - 'All other test message fields are shifted 1 byte / 8 bits' The parser expects pseudoMessageCode FIRST in the body (after header), but the old index ordering put it last, causing validation errors like: 'unencoded byte length is invalid - expected 1 but was 15' This happened because the deserializer sorts fields by index, so when both 'text' (index 11) and 'pseudoMessageCode' (index 14) were present, 'text' came first in the sorted array, violating the spec. Fix: Move pseudoMessageCode to index 7 (immediately after header fields), and shift all other body field indices up by 1. This ensures pseudoMessageCode always appears first in the body, matching the WhiteFlag specification. Fixes encoding of Test F messages and other test messages with body fields.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.