Пример #1
0
avim_group_impl::avim_group_impl(boost::asio::io_service& io, std::string key, std::string cert, std::string groupdeffile)
	: m_io_service(io)
	, m_core(io)
	, m_groupdef(groupdeffile)
{
	m_quitting = false;

	m_key = load_RSA_from_file(key);
	m_cert = load_X509_from_file(cert);

}
Пример #2
0
int
has_voms_extension(const char *certfilepath)
{
    ASN1_OBJECT *acseq_oid = NULL;
    X509 *cert = NULL;
    int position = -1;
    int result = -1;

    assert (certfilepath != NULL);

    acseq_oid = OBJ_txt2obj(ACSEQ_OID, 1);
    if (acseq_oid == NULL) {
        return result;
    }

    cert = load_X509_from_file(certfilepath);
    if (cert == NULL) {
        goto error;
    }

    position = X509_get_ext_by_OBJ(cert, acseq_oid, -1);
    if (position >= 0) {
        result = 1;
    } else {
        result = 0;
    }

    if (cert != NULL) {
        X509_free(cert);
    }

  error:

    if (acseq_oid != NULL) {
        ASN1_OBJECT_free(acseq_oid);
    }

    return result;
}