rfcs / crypto-conditions

Composable cryptographic conditionals (signatures, hashes)
https://tools.ietf.org/html/draft-thomas-crypto-conditions-03
22 stars 12 forks source link

Test Vector 0008_test-basic-threshold has incorrect MaxMessageSize? #26

Open sappenin opened 7 years ago

sappenin commented 7 years ago

The java-crypto-conditions library has a failing TestVector test surrounding the maxMessageLength in one of the subconditions in 0008_test-basic-threshold.json.

Initially, I though this was a bug in the Java library, but looking more closely, the main threshold condition in test vector 0008_test-basic-threshold has a prefix-sha-256 subcondition with its own ed25519-sha-256 subcondition that signs the message "aaa" (in ASCII).

Since the prefix-sha-256 condition has a maxMessageLength set to 0, the overall threshold fulfillment verification in Java always fails because the message being verified is too long once it hits the prefix subcondition -- the message length violates the maxMessageLength checks in the Java code.

Shouldn't the json.subfulfillments['prefix-sha-256].maxMessageLength be 3 instead of 0?

sappenin commented 4 years ago

This issue is fixed by https://github.com/rfcs/crypto-conditions/pull/39