Пример #1
0
void EVP_CIPHER_do_all (void (*fn) (const EVP_CIPHER * ciph, const char *from, const char *to, void *x), void *arg)
{
    struct doall_cipher dc;

    dc.fn = fn;
    dc.arg = arg;
    OBJ_NAME_do_all (OBJ_NAME_TYPE_CIPHER_METH, do_all_cipher_fn, &dc);
}
Пример #2
0
void EVP_MD_do_all (void (*fn) (const EVP_MD * md, const char *from, const char *to, void *x), void *arg)
{
    struct doall_md dc;

    dc.fn = fn;
    dc.arg = arg;
    OBJ_NAME_do_all (OBJ_NAME_TYPE_MD_METH, do_all_md_fn, &dc);
}
Пример #3
0
void EVP_MAC_do_all(void (*fn)
                    (const EVP_MAC *ciph, const char *from, const char *to,
                     void *x), void *arg)
{
    struct doall_mac dc;

    /* Ignore errors */
    OPENSSL_init_crypto(OPENSSL_INIT_ADD_ALL_MACS, NULL);

    dc.fn = fn;
    dc.arg = arg;
    OBJ_NAME_do_all(OBJ_NAME_TYPE_MAC_METH, do_all_mac_fn, &dc);
}
Пример #4
0
void OBJ_NAME_do_all_sorted(int type,void (*fn)(const OBJ_NAME *,void *arg),
				void *arg)
	{
	struct doall_sorted d;
	int n;

	d.type=type;
	d.names=OPENSSL_malloc(lh_num_items(names_lh)*sizeof *d.names);
	d.n=0;
	OBJ_NAME_do_all(type,do_all_sorted_fn,&d);

	qsort((void *)d.names,d.n,sizeof *d.names,do_all_sorted_cmp);

	for(n=0 ; n < d.n ; ++n)
		fn(d.names[n],arg);

	OPENSSL_free((void *)d.names);
	}
Пример #5
0
void OBJ_NAME_do_all_sorted(int type,
                            void (*fn) (const OBJ_NAME *, void *arg),
                            void *arg)
{
    struct doall_sorted d;
    int n;

    d.type = type;
    d.names =
        OPENSSL_malloc(lh_OBJ_NAME_num_items(names_lh) * sizeof *d.names);
    /* Really should return an error if !d.names...but its a void function! */
    if (d.names) {
        d.n = 0;
        OBJ_NAME_do_all(type, do_all_sorted_fn, &d);

        qsort((void *)d.names, d.n, sizeof *d.names, do_all_sorted_cmp);

        for (n = 0; n < d.n; ++n)
            fn(d.names[n], arg);

        OPENSSL_free((void *)d.names);
    }
}