[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn fails to handle certificates with non-ascii characters

From: Joe Orton <joe_at_manyfish.co.uk>
Date: 2004-02-15 13:33:11 CET

Anders, here's a patch to fix handling of non-ASCII DNs in neon, let me
know if this doesn't solve the problem:

Index: src/ne_openssl.c
===================================================================
RCS file: /home/cvs/neon/src/ne_openssl.c,v
retrieving revision 1.30
diff -u -r1.30 ne_openssl.c
--- src/ne_openssl.c 13 Nov 2003 22:47:18 -0000 1.30
+++ src/ne_openssl.c 15 Feb 2004 12:32:06 -0000
@@ -1,6 +1,6 @@
 /*
    neon SSL/TLS support using OpenSSL
- Copyright (C) 2002-2003, Joe Orton <joe@manyfish.co.uk>
+ Copyright (C) 2002-2004, Joe Orton <joe@manyfish.co.uk>
    Portions are:
    Copyright (C) 1999-2000 Tommi Komulainen <Tommi.Komulainen@iki.fi>
 
@@ -86,10 +86,34 @@
          * attribute in dname. */
         if ((OBJ_cmp(ent->object, cname) && OBJ_cmp(ent->object, email)) ||
             (!flag && n == 1)) {
- if (flag)
+ if (flag++)
                 ne_buffer_append(dump, ", ", 2);
- ne_buffer_append(dump, ent->value->data, ent->value->length);
- flag = 1;
+
+ switch (ent->value->type) {
+ case V_ASN1_UTF8STRING:
+ case V_ASN1_IA5STRING: /* definitely ASCII */
+ case V_ASN1_VISIBLESTRING: /* probably ASCII */
+ case V_ASN1_PRINTABLESTRING: /* subset of ASCII */
+ ne_buffer_append(dump, ent->value->data, ent->value->length);
+ break;
+ case V_ASN1_UNIVERSALSTRING:
+ case V_ASN1_T61STRING: /* let OpenSSL convert it as ISO-8859-1 */
+ case V_ASN1_BMPSTRING: {
+ unsigned char *tmp = ""; /* initialize to workaround 0.9.6 bug */
+ int len;
+
+ len = ASN1_STRING_to_UTF8(&tmp, ent->value);
+ if (len > 0) {
+ ne_buffer_append(dump, tmp, len);
+ OPENSSL_free(tmp);
+ break;
+ }
+ /* else fallthrough */
+ }
+ default:
+ ne_buffer_zappend(dump, "???");
+ break;
+ }
         }
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 15 13:33:29 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.