Corrected check for valid ASN1 types in rdn_enumerate.
authorTobias Brunner <tobias@strongswan.org>
Tue, 14 Jul 2009 09:55:09 +0000 (11:55 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 14 Jul 2009 10:09:22 +0000 (12:09 +0200)
Because of the range of u_char the comparison was always TRUE before.

src/libstrongswan/utils/identification.c

index 6816a7d..f006b40 100644 (file)
@@ -147,9 +147,10 @@ static bool rdn_enumerate(rdn_enumerator_t *this, chunk_t *oid,
                if (asn1_unwrap(&rdn, oid) == ASN1_OID)
                {
                        /* and a specific string type */
-                       *type = asn1_unwrap(&rdn, data);
-                       if (*type != ASN1_INVALID)
+                       int t = asn1_unwrap(&rdn, data);
+                       if (t != ASN1_INVALID)
                        {
+                               *type = t;
                                return TRUE;
                        }
                }