On Sat, Nov 22, 2008 at 10:38:18AM -0800, Shaun R. wrote: > Can anybody help me out, not sure whats going wrong. My test case right > now is the following > > signature = (unsigned char*) malloc(RSA_size(private_key)); > if(RSA_sign(NID_sha1, (unsigned char*) message, strlen(message), > signature, &slen, private_key) != 1) { > ERR_print_errors_fp(stdout); > } > > printf("%s", signature);
The signature is not a NUL terminated C-string, so using "printf" is not the right way to save it to a file. You are throwing away "slen", don't. -- Viktor. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]