#include <algorithms.h>
#include <abstract_int.h>
#include <x509/x509_int.h>
+#include <stdbool.h>
#include <fips.h>
#define MAX_STRING_LEN 512
_gnutls_x509_get_raw_dn2(ASN1_TYPE c2, gnutls_datum_t * raw,
const char *whom, gnutls_datum_t * dn);
-int
+bool
_gnutls_check_if_same_cert(gnutls_x509_crt_t cert1,
gnutls_x509_crt_t cert2);
-int
+bool
_gnutls_check_if_same_cert2(gnutls_x509_crt_t cert1,
gnutls_datum_t * cert2bin);
int _gnutls_strdatum_to_buf(gnutls_datum_t * d, void *buf,
size_t * sizeof_buf);
+bool _gnutls_is_same_dn(gnutls_x509_crt_t cert1, gnutls_x509_crt_t cert2);
+
#endif
#include <x509_int.h>
#include <common.h>
#include <gnutls_pk.h>
+#include <stdbool.h>
/* Checks if two certs are identical. Return 1 on match. */
-int
+bool
_gnutls_check_if_same_cert(gnutls_x509_crt_t cert1,
gnutls_x509_crt_t cert2)
{
return result;
}
-int
+bool
_gnutls_check_if_same_cert2(gnutls_x509_crt_t cert1,
gnutls_datum_t * cert2bin)
{
* Returns true or false, if the issuer is a CA,
* or not.
*/
-static int
+static bool
check_if_ca(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer,
unsigned int *max_path, unsigned int flags)
{
*
* Returns 1 if they match and (0) if they don't match.
*/
-static int is_issuer(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer)
+static bool is_issuer(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer)
{
uint8_t id1[MAX_KEY_ID_SIZE];
uint8_t id2[MAX_KEY_ID_SIZE];
/* Check if the given certificate is the issuer of the CRL.
* Returns 1 on success and 0 otherwise.
*/
-static int is_crl_issuer(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer)
+static bool is_crl_issuer(gnutls_x509_crl_t crl, gnutls_x509_crt_t issuer)
{
if (_gnutls_x509_compare_raw_dn
(&crl->raw_issuer_dn, &issuer->raw_dn) != 0)
* Returns 1 if they match and (0) if they don't match. Otherwise
* a negative error code is returned to indicate error.
*/
-int _gnutls_is_same_dn(gnutls_x509_crt_t cert1, gnutls_x509_crt_t cert2)
+bool _gnutls_is_same_dn(gnutls_x509_crt_t cert1, gnutls_x509_crt_t cert2)
{
if (_gnutls_x509_compare_raw_dn(&cert1->raw_dn, &cert2->raw_dn) !=
0)
* @sigalg: the signature algorithm used
* @flags: the specified verification flags
*/
-static int is_level_acceptable(
+static bool is_level_acceptable(
gnutls_x509_crt_t crt, gnutls_x509_crt_t issuer,
gnutls_sign_algorithm_t sigalg, unsigned flags)
{
* Output will hold some extra information about the verification
* procedure. Issuer will hold the actual issuer from the trusted list.
*/
-static int
+static bool
verify_crt(gnutls_x509_crt_t cert,
const gnutls_x509_crt_t * trusted_cas,
int tcas_size, unsigned int flags,