Skip to content

Port crypto_service updates from dms-be: pki merge, bug fixes, auth, ops - #3

Merged
jagnd1 merged 1 commit into
mainfrom
port/dms-crypto-service-updates
Sep 12, 2026
Merged

jagnd1 merged 1 commit into
mainfrom
port/dms-crypto-service-updates

Conversation

@jagnd1

@jagnd1 jagnd1 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

Brings the latest crypto_service changes from the internal dms-be repo into fmcrypto (the public version was ~1 year behind).

What's included

  • Bug fixes
    • exp_key: standalone export when pk is empty (returns key in LMK format, no wrapping)
    • urlsafe_b64decode: tolerate missing base64url padding (Android NO_PADDING fix)
    • TR-34 CMS: wrap EnvelopedData in ContentInfo(id-envelopedData) inside id-data eContent (fixes on-device "Malformed content"/digest mismatch)
  • pki_service merged into crypto_service — new /v1/serv endpoints (POST/PUT /cert, POST /crl); standalone pki_service/ removed; scripts/compose/CI/sonar updated
  • Auth middleware — common/middlewares/auth.py, common/config.py, common/schema.py (KeyType incl. IPEK), UnAuthException/ForbiddenException; routers use get_current_user(...). Permissive mode: anonymous requests allowed, credentials validated when present
  • Ops — Python 3.14, uvicorn --h11-max-incomplete-event-size 65536 (431 fix), urllib healthcheck, dependency bumps
  • Tests — ported dms crypto/pki router tests, updated adapter tests, new auth unit tests, common/adapter/csr_gen.py

Excluded (intentionally)

  • adapter/at, adapter/ps, app/utils/connector.py (dms platform-specific)
  • sqlalchemy dep and DB-related exception handling

Verification

  • 57 unit/integration/router tests pass
  • 26 live HTTP endpoint tests pass against a running instance

- standalone key export fix in exp_key (empty pk returns LMK key)
- base64url padding tolerance in common/utils/crypto.py
- TR-34 CMS fix: wrap EnvelopedData in ContentInfo(id-envelopedData)
- merge standalone pki_service into crypto_service (/v1/serv cert/crl)
- add auth middleware (get_current_user, optional/permissive for public use)
- add common/config.py, common/schema.py (KeyType incl. IPEK), UnAuth/Forbidden exceptions
- ops: python 3.14, uvicorn header-limit flag, urllib healthcheck, dep bumps
- remove pki_service; update scripts/compose/CI/sonar/config
- port dms crypto/pki tests (unit, integration, e2e) + common/adapter/csr_gen.py
@jagnd1
jagnd1 merged commit 7aa7bb9 into main Sep 12, 2026
1 check failed
@jagnd1
jagnd1 deleted the port/dms-crypto-service-updates branch September 12, 2026 20:11
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