hyperledger / anoncreds-v2-rs

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

fix out of range panic #30

Closed haroldcarr closed 4 months ago

haroldcarr commented 4 months ago

Signed-off-by: Harold Carr 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

w00t!! :-). Thanks! Looks like there are some lint issues in the code — can you fix, please? They are specific to your addition — details are here.

Darn — I see it got merged already.

BTW - if you are using the git command line — git commit -s -m “commit comment” gets the DCO sign-off — the -s option on the commit.

haroldcarr commented 4 months ago

@swcurran : since it was already merge, could you make the format change?

BTW: thanks for the tip - I use emacs/magit

mikelodder7 commented 4 months ago

It's no different if I do it vs you. I'd rather give you the credit