Since it is a fixed size (20 bytes) a define would be appropriate, e.g. #define SHA1_KEY_SIZE 20
Carter Carter Browne CBCS cbro...@cbcs-usa.com 781-721-2890 Goblin_Queen wrote: > If this is wrong again, could you please tell me what IS the correct way of > getting the size of sha1_data2? I don't think I know other options than > sizeof or strlen... > > > > Victor Duchovni wrote: > >> On Mon, Mar 30, 2009 at 06:57:02AM -0700, Goblin_Queen wrote: >> >> >>> Thanks for pointing that out Stephen, as I said before, I'm still >>> learning >>> C++, so that's why I made such a stupid mistake. I suppose the correct >>> size >>> of sha1_data2 is strlen((const char*)sha1_data2), and that gives me 20 >>> instead of 4, which sounds more reasonable. >>> >> No, this is still wrong, because some 20-byte SHA-1 signatures contain >> ASCII-NUL bytes. SHA-1 signatures are always 20 bytes (160 bits). >> >> -- >> Viktor. >> ______________________________________________________________________ >> OpenSSL Project http://www.openssl.org >> User Support Mailing List openssl-users@openssl.org >> Automated List Manager majord...@openssl.org >> >> >> > > ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org