What changed, and why it matters
This commit reduces the visibility of internal fields on three error types in the crypto/sighash module from public to crate-internal. It is a routine API-hardening change to preserve future flexibility before a 1.0 stable release. There is no security vulnerability here.
No security action required. Treat as a normal API-breaking change; downstream users relying on direct field access will need to update their code.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes three error structs in crypto/src/sighash.rs: InvalidSighashTypeError and NonStandardSighashTypeError fields become pub(crate), and SighashTypeParseError’s ‘unrecognized’ field becomes pub(super). This is a breaking API change that hides implementation details; it does not alter behavior, validation, cryptography, or memory safety.
Changed components
crypto/src/sighash.rs error types: InvalidSighashTypeError, NonStandardSighashTypeError, SighashTypeParseErrorInspect captured patch +3 / −3
diff --git a/crypto/src/sighash.rs b/crypto/src/sighash.rs
index f3062ba1..83186614 100644
--- a/crypto/src/sighash.rs
+++ b/crypto/src/sighash.rs
@@ -233,7 +233,7 @@ pub mod error {
/// Integer is not a consensus valid sighash type.
#[derive(Debug, Clone, PartialEq, Eq)]
- pub struct InvalidSighashTypeError(pub u32);
+ pub struct InvalidSighashTypeError(pub(crate) u32);
impl fmt::Display for InvalidSighashTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -252,7 +252,7 @@ pub mod error {
/// This type is consensus valid but an input including it would prevent the transaction from
/// being relayed on today's Bitcoin network.
#[derive(Debug, Clone, PartialEq, Eq)]
- pub struct NonStandardSighashTypeError(pub u32);
+ pub struct NonStandardSighashTypeError(pub(crate) u32);
impl fmt::Display for NonStandardSighashTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -275,7 +275,7 @@ pub mod error {
#[non_exhaustive]
pub struct SighashTypeParseError {
/// The unrecognized string we attempted to parse.
- pub unrecognized: InputString,
+ pub(super) unrecognized: InputString,
}
impl fmt::Display for SighashTypeParseError {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.