summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2012-10-01 21:32:51 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2012-10-01 21:35:28 +0200
commit5d511c883afc398444f422ce1ae8c38e75491227 (patch)
treeea29b88b67b15b7c4a3e5cf1e8b0e897fcdc7fa1
parent7b9d0158f022b8468ea7cd362ef9142889f4ff29 (diff)
downloadgnutls-5d511c883afc398444f422ce1ae8c38e75491227.tar.gz
gnutls_ocsp_resp_check_crt() accepts the response index.
-rw-r--r--lib/includes/gnutls/ocsp.h6
-rw-r--r--lib/x509/ocsp.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/includes/gnutls/ocsp.h b/lib/includes/gnutls/ocsp.h
index 70343a23e9..52ea02856a 100644
--- a/lib/includes/gnutls/ocsp.h
+++ b/lib/includes/gnutls/ocsp.h
@@ -249,9 +249,9 @@ extern "C"
unsigned int *verify,
unsigned int flags);
-int
-gnutls_ocsp_resp_check_crt (gnutls_ocsp_resp_t resp,
- gnutls_x509_crt_t crt);
+ int gnutls_ocsp_resp_check_crt (gnutls_ocsp_resp_t resp,
+ unsigned int indx,
+ gnutls_x509_crt_t crt);
#ifdef __cplusplus
}
diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c
index 3aca0f52f7..d3849e8668 100644
--- a/lib/x509/ocsp.c
+++ b/lib/x509/ocsp.c
@@ -1277,6 +1277,7 @@ gnutls_ocsp_resp_get_produced (gnutls_ocsp_resp_t resp)
/**
* gnutls_ocsp_resp_check_crt:
* @resp: should contain a #gnutls_ocsp_resp_t structure
+ * @indx: Specifies response number to get. Use (0) to get the first one.
* @crt: The certificate to check
*
* This function will check whether the OCSP response
@@ -1287,6 +1288,7 @@ gnutls_ocsp_resp_get_produced (gnutls_ocsp_resp_t resp)
**/
int
gnutls_ocsp_resp_check_crt (gnutls_ocsp_resp_t resp,
+ unsigned int indx,
gnutls_x509_crt_t crt)
{
int ret;
@@ -1297,7 +1299,7 @@ gnutls_datum_t dn = {NULL, 0};
uint8_t cdn_hash[MAX_HASH_SIZE];
size_t t, hash_len;
- ret = gnutls_ocsp_resp_get_single (resp, 0, &digest, &rdn_hash, NULL,
+ ret = gnutls_ocsp_resp_get_single (resp, indx, &digest, &rdn_hash, NULL,
&rserial, NULL, NULL, NULL, NULL, NULL);
if (ret < 0)
return gnutls_assert_val(ret);
@@ -1374,7 +1376,7 @@ cleanup:
/**
* gnutls_ocsp_resp_get_single:
* @resp: should contain a #gnutls_ocsp_resp_t structure
- * @indx: Specifies which extension OID to get. Use (0) to get the first one.
+ * @indx: Specifies response number to get. Use (0) to get the first one.
* @digest: output variable with #gnutls_digest_algorithm_t hash algorithm
* @issuer_name_hash: output buffer with hash of issuer's DN
* @issuer_key_hash: output buffer with hash of issuer's public key