more informative error messages when cert verification fails

SVN revision: 66012
This commit is contained in:
Mike Blumenkrantz 2011-12-08 03:56:29 +00:00
parent 936f6aa7fa
commit 29f67c9bc5
1 changed files with 10 additions and 2 deletions

View File

@ -332,10 +332,18 @@ _openssl_name_verify(const char *name, const char *svrname)
EINA_SAFETY_ON_TRUE_RETURN_VAL(!s, EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(!s, EINA_FALSE);
/* same as above for the stored name */ /* same as above for the stored name */
EINA_SAFETY_ON_TRUE_RETURN_VAL(!strchr(s + 1, '.'), EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(!strchr(s + 1, '.'), EINA_FALSE);
EINA_SAFETY_ON_TRUE_RETURN_VAL(strcasecmp(s, name + 1), EINA_FALSE); if (strcasecmp(s, name + 1))
{
ERR("%s != %s", s, name + 1);
return EINA_FALSE;
}
} }
else else
EINA_SAFETY_ON_TRUE_RETURN_VAL(strcasecmp(name, svrname), EINA_FALSE); if (strcasecmp(name, svrname))
{
ERR("%s != %s", name, svrname);
return EINA_FALSE;
}
return EINA_TRUE; return EINA_TRUE;
} }