Home GnuPG

tests: Fix conversion of random zbase32 data to string

Description

tests: Fix conversion of random zbase32 data to string

* tests/run-genrandom.cpp (main): Pass data to std::string constructor
instead of copying it byte by byte.

The byte-by-byte conversion erroneously copied the terminating null byte
into the string. Passing the random \0-terminated zbase32 data to the
std::string constructor fixes the conversion and demonstrates how I
envisioned the conversion to a string. Unfortunately, one has to
reinterpret the pointer.

Details

Provenance
ikloeckerAuthored on Tue, Feb 17, 1:52 PM
Parents
rGPGMEPPbd287926c866: doc: Document generateRandomBytes
Branches
Unknown
Tags
Unknown
References
HEAD -> master
Tasks
T8108: Gpgmepp getrandom zbase32 code has zero byte at the end