Loading changes/ticket21037 0 → 100644 +4 −0 Original line number Diff line number Diff line o Minor features (logging): - In several places, describe unset ed25519 keys as "<unset>", rather than "AAAAAAAA...AAA". Closes ticket 21037. src/common/crypto_format.c +9 −4 Original line number Diff line number Diff line Loading @@ -161,16 +161,21 @@ curve25519_public_from_base64(curve25519_public_key_t *pkey, } } /** For convenience: Convert <b>pkey</b> to a statically allocated base64 * string and return it. Not threadsafe. Subsequent calls invalidate /** For logging convenience: Convert <b>pkey</b> to a statically allocated * base64 string and return it. Not threadsafe. Format not meant to be * computer-readable; it may change in the future. Subsequent calls invalidate * previous returns. */ const char * ed25519_fmt(const ed25519_public_key_t *pkey) { static char formatted[ED25519_BASE64_LEN+1]; if (pkey) { if (ed25519_public_key_is_zero(pkey)) { strlcpy(formatted, "<unset>", sizeof(formatted)); } else { int r = ed25519_public_to_base64(formatted, pkey); tor_assert(!r); } } else { strlcpy(formatted, "<null>", sizeof(formatted)); } Loading Loading
changes/ticket21037 0 → 100644 +4 −0 Original line number Diff line number Diff line o Minor features (logging): - In several places, describe unset ed25519 keys as "<unset>", rather than "AAAAAAAA...AAA". Closes ticket 21037.
src/common/crypto_format.c +9 −4 Original line number Diff line number Diff line Loading @@ -161,16 +161,21 @@ curve25519_public_from_base64(curve25519_public_key_t *pkey, } } /** For convenience: Convert <b>pkey</b> to a statically allocated base64 * string and return it. Not threadsafe. Subsequent calls invalidate /** For logging convenience: Convert <b>pkey</b> to a statically allocated * base64 string and return it. Not threadsafe. Format not meant to be * computer-readable; it may change in the future. Subsequent calls invalidate * previous returns. */ const char * ed25519_fmt(const ed25519_public_key_t *pkey) { static char formatted[ED25519_BASE64_LEN+1]; if (pkey) { if (ed25519_public_key_is_zero(pkey)) { strlcpy(formatted, "<unset>", sizeof(formatted)); } else { int r = ed25519_public_to_base64(formatted, pkey); tor_assert(!r); } } else { strlcpy(formatted, "<null>", sizeof(formatted)); } Loading