<?xml version="1.0" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugzilla.globus.org/bugzilla/bugzilla.dtd">

<bugzilla version="3.2.3"
          urlbase="http://bugzilla.globus.org/bugzilla/"
          maintainer="bacon@mcs.anl.gov"
>

    <bug>
          <bug_id>6642</bug_id>
          
          <creation_ts>2009-02-09 10:52</creation_ts>
          <short_desc>jglobus signing_policy checking should be case insensitive</short_desc>
          <delta_ts>2009-02-09 17:51:07</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CoG jglobus</product>
          <component>security</component>
          <version>1.6.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <keywords>4.0.x</keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.7</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jim Basney">jbasney@ncsa.uiuc.edu</reporter>
          <assigned_to name="Rachana Ananthakrishnan">ranantha@mcs.anl.gov</assigned_to>
          <cc>jglobus-dev@globus.org</cc>

      

      
          <long_desc isprivate="0">
            <who name="Jim Basney">jbasney@ncsa.uiuc.edu</who>
            <bug_when>2009-02-09 10:52:59</bug_when>
            <thetext>Currently, the jglobus signing_policy checking is case sensitive while the C signing_policy checking is case insensitive. In the C code, globus_i_gsi_cert_utils_dn_cmp() calls strcasecmp(), i.e., string comparison ignoring case.

David Groep explains:
&gt; Actually: almost all attributes you would legitimately encounter
&gt; in a DN are subtypes of attributeType &apos;name&apos;, which has
&gt;   EQUALITY MATCHING RULE caseIgnoreMatch
&gt;   SUBSTRINGS MATCHING RULE caseIgnoreSubstringsMatch
&gt; as its definition in X.520.
&gt; So, even when transliterated into a plain string representation (as in the
&gt; &quot;/&quot;-separated or &quot;,&quot;-separated formats) the comparison ought to be
&gt; case-INsensitive.
&gt; 
&gt; There is only one caveat: caseIgnoreMatch can only be done if the
&gt; original encoding of the attribute value is PrintableString or IA5STring.
&gt; There is no defined algorithm to do a caseIgnoreMatch for UTF8 strings.
&gt; So, if the original encoding of the attribute in the certificate was
&gt; UTF8String, the matching ought to be exact. Alas: once transliterated
&gt; into the &quot;/&quot; or &quot;,&quot; string representation, the knowledge of the original
&gt; attribute encoding is lost forever :-((
&gt; Which is why one SHOULD have done matching on the original ASN.1 structure
&gt; of the DN ...
&gt; 
&gt; For the time being: you&apos;re likely fine doing case-insensitive matching
&gt; unless
&gt; the content of the DN is obviously UTF8  :-)

Here&apos;s a patch to bring jglobus in line with the C signing_policy code:

diff -u -r1.4 SigningPolicyParser.java
--- src/org/globus/gsi/SigningPolicyParser.java	10 Apr 2008 00:20:32 -0000	1.4
+++ src/org/globus/gsi/SigningPolicyParser.java	9 Feb 2009 16:47:03 -0000
@@ -526,7 +526,7 @@
         
         logger.debug(&quot;String with replaced pattern is &quot; + patternStr);
         
-        return Pattern.compile(patternStr);
+        return Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);
     }
 
     // find first space or tab as separator.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who name="Rachana Ananthakrishnan">ranantha@mcs.anl.gov</who>
            <bug_when>2009-02-09 17:51:07</bug_when>
            <thetext>Thanks Jim.

Fixed committed to trunk and 4.0.x branch</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>