From fd0df7ec75db392e89c3bd6e59a6a8669463a3c7 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 14 Jul 2009 11:55:09 +0200 Subject: [PATCH] Corrected check for valid ASN1 types in rdn_enumerate. Because of the range of u_char the comparison was always TRUE before. --- src/libstrongswan/utils/identification.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libstrongswan/utils/identification.c b/src/libstrongswan/utils/identification.c index 6816a7d8c..f006b40a7 100644 --- a/src/libstrongswan/utils/identification.c +++ b/src/libstrongswan/utils/identification.c @@ -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; } }