}
/* }}} */
-static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected TSRMLS_DC)
+static int php_x509_fingerprint_cmp(X509 *peer, const char *method, const char *expected)
{
- char *fingerprint;
- int fingerprint_len;
+ zend_string *fingerprint;
int result = -1;
- if (php_openssl_x509_fingerprint(peer, method, 0, &fingerprint, &fingerprint_len TSRMLS_CC) == SUCCESS) {
- result = strcasecmp(expected, fingerprint);
- efree(fingerprint);
+ fingerprint = php_openssl_x509_fingerprint(peer, method, 0);
+ if (fingerprint) {
- result = strcmp(expected, fingerprint->val);
++ result = strcasecmp(expected, fingerprint->val);
+ zend_string_release(fingerprint);
}
return result;