diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-12-20 08:36:25 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-12-20 08:36:25 -0500 |
commit | a517daa56f5848d25ba79617a1a7b82ed2b0a7c0 (patch) | |
tree | 88bddb2445449578fefd399ed73a46435113bf2c /src/test/test_crypto.c | |
parent | 973a5db80851838e4516de40afe028bc10c425f0 (diff) | |
download | tor-a517daa56f5848d25ba79617a1a7b82ed2b0a7c0.tar.gz tor-a517daa56f5848d25ba79617a1a7b82ed2b0a7c0.zip |
base32_decode(): Return number of bytes written on success.
This makes it consistent with base64_decode().
Closes ticket 28913.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 81d2fa6f33..e924cea423 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -1865,13 +1865,13 @@ test_crypto_base32_decode(void *arg) /* Encode and decode a random string. */ base32_encode(encoded, 96 + 1, plain, 60); res = base32_decode(decoded, 60, encoded, 96); - tt_int_op(res,OP_EQ, 0); + tt_int_op(res, OP_EQ, 60); tt_mem_op(plain,OP_EQ, decoded, 60); /* Encode, uppercase, and decode a random string. */ base32_encode(encoded, 96 + 1, plain, 60); tor_strupper(encoded); res = base32_decode(decoded, 60, encoded, 96); - tt_int_op(res,OP_EQ, 0); + tt_int_op(res, OP_EQ, 60); tt_mem_op(plain,OP_EQ, decoded, 60); /* Change encoded string and decode. */ if (encoded[0] == 'A' || encoded[0] == 'a') @@ -1879,12 +1879,12 @@ test_crypto_base32_decode(void *arg) else encoded[0] = 'A'; res = base32_decode(decoded, 60, encoded, 96); - tt_int_op(res,OP_EQ, 0); + tt_int_op(res, OP_EQ, 60); tt_mem_op(plain,OP_NE, decoded, 60); /* Bad encodings. */ encoded[0] = '!'; res = base32_decode(decoded, 60, encoded, 96); - tt_int_op(0, OP_GT, res); + tt_int_op(res, OP_LT, 0); done: ; |