Skip to content

Add safe catch-all for secp256k1::Error conversion in HpkeError#1298

Open
Mshehu5 wants to merge 1 commit intopayjoin:masterfrom
Mshehu5:secp_err
Open

Add safe catch-all for secp256k1::Error conversion in HpkeError#1298
Mshehu5 wants to merge 1 commit intopayjoin:masterfrom
Mshehu5:secp_err

Conversation

@Mshehu5
Copy link
Contributor

@Mshehu5 Mshehu5 commented Jan 25, 2026

Closes: #1274

Replace panic with a match to Other(String) to handle unknown secp256k1 error variants. This prevents crashes for unknown varients and if new variants are added upstream.

Pull Request Checklist

Please confirm the following before requesting review:

Replace panic with Other(String) variant to handle unknown secp256k1 error variants. This prevents crashes for unknown varients and if new variants are added upstream.
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 21340164710

Details

  • 17 of 20 (85.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 83.213%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin/src/core/hpke.rs 17 20 85.0%
Totals Coverage Status
Change from base Build 21287723795: 0.01%
Covered Lines: 10157
Relevant Lines: 12206

💛 - Coveralls

Copy link
Collaborator

@benalleng benalleng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cACK seems simple enough, not sure if there was another approach in mind but this seems simple enough to catch the unhandled errors

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.

Replace panic in HpkeError secp256k1 conversion with safe error handling

3 participants