Description:
Minor changes to help test and clarify the way utf8 strings are
decoded. This originated from my misunderstanding of the fix for
issue #507. The new test-vector uses two bytes to encode each
wide-char.
The utf8 format is described here:
https://tools.ietf.org/html/rfc3629#section-3
Testing:
$ make clean
$ make CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" test
$ ./test
You can confirm that the new utf8 test data is correct using python:
>>> s="\xD7\xA9\xD7\x9C\xD7\x95\xD7\x9D"
>>> s.decode("utf-8")
u'\u05e9\u05dc\u05d5\u05dd'
PR #373 did not really fix the issue of preventing a potential stack
overflow in case a lot of nested sequences have to be decoded.
Instead it only threw an error after successfully decoding all the nested
sequences.
This change fixes this and prevents the decoding.
Wrap signature format in #ifdef LTC_SSH
Update docs
Code review fixes
Replace strcmp/memcmp with XSTRCMP/XMEMCMP for check-source
Fix for check-defines
XSTRCMP/XMEMCMP != 0
GCC7.3 wants only literal strings for sprintf format
Code review changes
Rework SSH decoding and tests
Fix encoding and tests
COMPARE_TESTVECTOR macro
Single return point in ssh_decode_sequence_multi
Actually use XSTRNCPY rather than just defining it
More code review fixes
Code review tweaks
Ensure it's not possible to read past buffer end
Keep track of size remaining, not end pointer
Optionally return recovery ID from ecc_sign_hash()
Update documentation
Update tests for ECC recovery
Fix (v,r,s) signature format, regenerate recovery test
Fix over-freeing of private key
Code review fixes to docs
Rename LTC_ECCSIG_BLOCKCHAIN to LTC_ECCSIG_ETH to reflect original definition
Rename to LTC_ECCSIG_ETH27 to make clear it's using the Ethereum +27 convention
Code review changes - calculate recovery ID only if needed, type safety on signature format enum
Use enum for sigformat in docs, and add explanatory note for recid<0
Range checks on v, check RFC7518 signatures' length based on size of key. Fix for when order>prime.
Limit LET_ECCSIG_ETH27 to secp256k1 curve only
Workaround for TFM missing sqrtmod_prime
Fix unused variable warnings with USE_TFM, make TomsFastMath a runtime check
Disable ecc_recover_key if no ecc_mul2add available
Wrap ecc_recover_key and its test in #ifdef LTC_ECC_SHAMIR
Fix unused variables when built without LTC_ECC_SHAMIR
Code review tweaks
Code review tweaks - remove sigformat, tidy up (de)allocation
Code review tweaks