In function ASN1_STRING_to_UTF8 why do you check for NULL on |!*out|? Why can't the character pointer point to NULL? If I understand your function correctly it allocates the memory so NULL makes perfect sense. Maybe it should be |!out| so you know that |out| actually points to something? My testing is with 0.9.6d but a quick look at version 0.9.7 beta 2 looks like it behaves the same way.
"crypto/asn1/a_strex.c" line 514 /* Utility function: convert any string type to UTF8, returns number of bytes * in output string or a negative error code */ int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in) { ASN1_STRING stmp, *str = &stmp; int mbflag, type, ret; if(!*out || !in) return -1; EXAMPLES: This code fails unsigned char * in = NULL; ASN1_STRING in = .....; ASN1_STRING_to_UTF8(&out, &in); but this works (copied from "crypto/pkcs12/p12_kiss.c" line 253) if(fname) { int len; unsigned char *data; len = ASN1_STRING_to_UTF8(&data, fname); if(len > 0) { X509_alias_set1(x509, data, len); OPENSSL_free(data); } In addition, why can't it accept a string of type V_ASN1_UTF8STRING (value 12)? It always fails on "crypto/asn1/a_mbstr.c" line 142 ASN1err(ASN1_F_ASN1_MBSTRING_COPY, ASN1_R_UNKNOWN_FORMAT); I realize all I have to do is copy the buffer manually as a workaround, but I was trying to avoid treating it as a special case. Thanks, Christopher Nebergall ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]