예제 #1
0
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
{
    nid_triple *ntr;
    if (!sig_app)
        sig_app = sk_nid_triple_new(sig_sk_cmp);
    if (!sig_app)
        return 0;
    if (!sigx_app)
        sigx_app = sk_nid_triple_new(sigx_cmp);
    if (!sigx_app)
        return 0;
    ntr = reallocarray(NULL, 3, sizeof(int));
    if (!ntr)
        return 0;
    ntr->sign_id = signid;
    ntr->hash_id = dig_id;
    ntr->pkey_id = pkey_id;

    if (!sk_nid_triple_push(sig_app, ntr)) {
        free(ntr);
        return 0;
    }

    if (!sk_nid_triple_push(sigx_app, ntr))
        return 0;

    sk_nid_triple_sort(sig_app);
    sk_nid_triple_sort(sigx_app);

    return 1;
}
예제 #2
0
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
	{
	nid_triple *ntr;
	if (!sig_app)
		sig_app = sk_nid_triple_new(sig_sk_cmp);
	if (!sig_app)
		return 0;
	if (!sigx_app)
		sigx_app = sk_nid_triple_new(sigx_cmp);
	if (!sigx_app)
		return 0;
	ntr = (nid_triple*)OPENSSL_malloc(sizeof(int) * 3);
	if (!ntr)
		return 0;
	ntr->sign_id = signid;
	ntr->hash_id = dig_id;
	ntr->pkey_id = pkey_id;

	if (!sk_nid_triple_push(sig_app, ntr))
		{
		OPENSSL_free(ntr);
		return 0;
		}

	if (!sk_nid_triple_push(sigx_app, ntr))
		return 0;

	sk_nid_triple_sort(sig_app);
	sk_nid_triple_sort(sigx_app);

	return 1;
	}
예제 #3
0
파일: obj_xref.c 프로젝트: Ana06/openssl
int OBJ_add_sigid(int signid, int dig_id, int pkey_id)
{
    nid_triple *ntr;
    if (sig_app == NULL)
        sig_app = sk_nid_triple_new(sig_sk_cmp);
    if (sig_app == NULL)
        return 0;
    if (sigx_app == NULL)
        sigx_app = sk_nid_triple_new(sigx_cmp);
    if (sigx_app == NULL)
        return 0;
    if ((ntr = OPENSSL_malloc(sizeof(*ntr))) == NULL) {
        OBJerr(OBJ_F_OBJ_ADD_SIGID, ERR_R_MALLOC_FAILURE);
        return 0;
    }
    ntr->sign_id = signid;
    ntr->hash_id = dig_id;
    ntr->pkey_id = pkey_id;

    if (!sk_nid_triple_push(sig_app, ntr)) {
        OPENSSL_free(ntr);
        return 0;
    }

    if (!sk_nid_triple_push(sigx_app, ntr))
        return 0;

    sk_nid_triple_sort(sig_app);
    sk_nid_triple_sort(sigx_app);

    return 1;
}