hyperledger / anoncreds-v2-rs

Anonymous Credential Exchange 2.0
Apache License 2.0
34 stars 13 forks source link

fix out of range panic #29

Closed haroldcarr closed 4 months ago

haroldcarr commented 4 months ago

Signed-off-by: Harold Carrr harold.carr@oracle.com

This adds a test case that expects InvalidPresentationData when someone tries to create a range proof with a value that is outside the required range.

Without the fix, it panics:

thread 'out_of_range_panic' panicked at 'attempt to add with overflow', src/presentation/range.rs:147:38

This PR adds a check for out of range in presentation/range.rs in RangeBuilder.commit.

swcurran commented 4 months ago

DCO didn’t work. I think the issue is that your name has three “r”s in it Carrr. Arrggh…. :-(

haroldcarr commented 4 months ago

hmm, can't even spell my own name!?