diff options
Diffstat (limited to 'lib/x509/common.c')
-rw-r--r-- | lib/x509/common.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/x509/common.c b/lib/x509/common.c index fbc7cc975f..c8ea6657c7 100644 --- a/lib/x509/common.c +++ b/lib/x509/common.c @@ -1809,29 +1809,20 @@ gnutls_x509_crt_t *_gnutls_sort_clist(gnutls_x509_crt_t int _gnutls_check_if_sorted(gnutls_x509_crt_t * crt, int nr) { - void *prev_dn = NULL; - void *dn; - size_t prev_dn_size = 0, dn_size; int i, ret; /* check if the X.509 list is ordered */ if (nr > 1) { for (i = 0; i < nr; i++) { if (i > 0) { - dn = crt[i]->raw_dn.data; - dn_size = crt[i]->raw_dn.size; - - if (dn_size != prev_dn_size - || memcmp(dn, prev_dn, dn_size) != 0) { + if (!_gnutls_x509_compare_raw_dn(&crt[i]->raw_dn, + &crt[i-1]->raw_issuer_dn)) { ret = gnutls_assert_val (GNUTLS_E_CERTIFICATE_LIST_UNSORTED); goto cleanup; } } - - prev_dn = crt[i]->raw_issuer_dn.data; - prev_dn_size = crt[i]->raw_issuer_dn.size; } } ret = 0; |