/* Loads the certificate * If mand is non zero then a certificate is mandatory. Otherwise * null will be returned if the certificate loading fails. */ gnutls_x509_crt_t load_cert(int mand, common_info_st * info) { gnutls_x509_crt_t *crt; size_t size; crt = load_cert_list(mand, &size, info); return crt ? crt[0] : NULL; }
/* Loads the certificate * If mand is non zero then a certificate is mandatory. Otherwise * null will be returned if the certificate loading fails. */ gnutls_x509_crt_t load_cert(int mand, common_info_st * info) { gnutls_x509_crt_t *crt; gnutls_x509_crt_t ret_crt; size_t size, i; crt = load_cert_list(mand, &size, info); if (crt) { ret_crt = crt[0]; for (i=1;i<size;i++) gnutls_x509_crt_deinit(crt[i]); gnutls_free(crt); return ret_crt; } return NULL; }