I ran into a build failure with snmp2 0.5.0 — it stops compiling as soon as something else in my dependency tree turns on the reset feature of the hmac crate.
In src/v3.rs, calculate_hmac does mac.update(data) with both hmac::Mac and digest::DynDigest imported. Hmac<D> always implements Mac. With hmac/reset enabled it also picks up Reset/FixedOutputReset, which is enough to satisfy DynDigest's blanket impl — so both traits now offer update(&mut self, &[u8]) and the call is ambiguous.
Minimal repro — two dependencies, then cargo build:
[dependencies]
snmp2 = { version = "0.5", features = ["v3"] }
hmac = { version = "0.12", features = ["reset"] }
error[E0034]: multiple applicable items in scope
--> snmp2-0.5.0/src/v3.rs:352:25
= note: candidate #1 is defined in an impl of the trait `DynDigest` for the type `D`
= note: candidate #2 is defined in an impl of the trait `Mac` for the type `T`
Six of these, one per HMAC variant in calculate_hmac. Without hmac/reset it builds fine, which is probably why CI hasn't caught it. The fix is just to fully-qualify the calls as Mac::update(...).
I ran into a build failure with
snmp2 0.5.0— it stops compiling as soon as something else in my dependency tree turns on theresetfeature of thehmaccrate.In
src/v3.rs,calculate_hmacdoesmac.update(data)with bothhmac::Macanddigest::DynDigestimported.Hmac<D>always implementsMac. Withhmac/resetenabled it also picks upReset/FixedOutputReset, which is enough to satisfyDynDigest's blanket impl — so both traits now offerupdate(&mut self, &[u8])and the call is ambiguous.Minimal repro — two dependencies, then
cargo build:Six of these, one per HMAC variant in
calculate_hmac. Withouthmac/resetit builds fine, which is probably why CI hasn't caught it. The fix is just to fully-qualify the calls asMac::update(...).