diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2007-11-21 17:25:58 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2007-11-21 17:25:58 +0000 |
commit | 2f0550c4c1b622540091368eabada3f5e4549976 (patch) | |
tree | 3891fa284942ec541c74c4be8117fb5455d9171e /crypto/engine/eng_table.c | |
parent | 98057eba7794790f6de51da83f3c9ed8faf3279b (diff) |
Lookup public key ASN1 methods by string by iterating through all
implementations instead of all added ENGINEs to cover case where an
ENGINE is not added.
Diffstat (limited to 'crypto/engine/eng_table.c')
-rw-r--r-- | crypto/engine/eng_table.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c index 0c1656168d..3e892c8a62 100644 --- a/crypto/engine/eng_table.c +++ b/crypto/engine/eng_table.c @@ -76,6 +76,14 @@ struct st_engine_table LHASH piles; }; /* ENGINE_TABLE */ + +typedef struct st_engine_pile_doall + { + engine_table_doall_cb *cb; + void *arg; + } ENGINE_PILE_DOALL; + + /* Global flags (ENGINE_TABLE_FLAG_***). */ static unsigned int table_flags = 0; @@ -313,3 +321,21 @@ end: ERR_clear_error(); return ret; } + +/* Table enumeration */ + +static void int_doall_cb(ENGINE_PILE *pile, ENGINE_PILE_DOALL *dall) + { + dall->cb(pile->nid, pile->sk, pile->funct, dall->arg); + } + +static IMPLEMENT_LHASH_DOALL_ARG_FN(int_doall_cb,ENGINE_PILE *,ENGINE_PILE_DOALL *) +void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb, + void *arg) + { + ENGINE_PILE_DOALL dall; + dall.cb = cb; + dall.arg = arg; + lh_doall_arg(&table->piles, + LHASH_DOALL_ARG_FN(int_doall_cb), &dall); + } |