[PATCH 3/5] Fix typo in search_oid

Dmitry Eremin-Solenikov dbaryshkov at gmail.com
Mon Dec 30 21:39:56 CET 2013


* cipher/md.c (search_oid): Invert condition on oid comparison.

--
Function stricmp() returns 0 in case strings match, so proper condition
that checks for matching OID strings should be if (!stricmp(...))

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
 cipher/md.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cipher/md.c b/cipher/md.c
index d9c1ad4..1b59765 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -195,7 +195,7 @@ search_oid (const char *oid, gcry_md_oid_spec_t *oid_spec)
   if (spec && spec->oids)
     {
       for (i = 0; spec->oids[i].oidstring; i++)
-	if (stricmp (oid, spec->oids[i].oidstring))
+	if (!stricmp (oid, spec->oids[i].oidstring))
 	  {
 	    if (oid_spec)
 	      *oid_spec = spec->oids[i];
-- 
1.8.5.2




More information about the Gcrypt-devel mailing list