diff options
author | hylee <none@none> | 2007-12-06 15:56:13 -0800 |
---|---|---|
committer | hylee <none@none> | 2007-12-06 15:56:13 -0800 |
commit | 431deaa01ac039d796fdfaf86b909a75e7d9ac48 (patch) | |
tree | 0d4bb232b811d43a31fcb0d6149d0624c643e3f4 /usr/src/cmd/cmd-crypto/kmfcfg/util.c | |
parent | c73e9863820a560b7fbb4fb258aa450a88315a39 (diff) | |
download | illumos-joyent-431deaa01ac039d796fdfaf86b909a75e7d9ac48.tar.gz |
PSARC 2007/604 KMF Pluggability Enhancements
6621224 KMF Dynamic Plugin Support
6621231 pktool list keystore=file dir=/tmp/test prints out incorrect output
Diffstat (limited to 'usr/src/cmd/cmd-crypto/kmfcfg/util.c')
-rw-r--r-- | usr/src/cmd/cmd-crypto/kmfcfg/util.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/usr/src/cmd/cmd-crypto/kmfcfg/util.c b/usr/src/cmd/cmd-crypto/kmfcfg/util.c index 3fce0c839d..f151e454ce 100644 --- a/usr/src/cmd/cmd-crypto/kmfcfg/util.c +++ b/usr/src/cmd/cmd-crypto/kmfcfg/util.c @@ -34,9 +34,9 @@ #include <libxml/parser.h> #include <kmfapiP.h> - #include "util.h" + /* Supporting structures and global variables for getopt_av(). */ typedef struct av_opts_s { int shortnm; /* short name character */ @@ -490,3 +490,31 @@ print_sanity_error(KMF_RETURN ret) break; } } + + +conf_entry_t * +get_keystore_entry(char *kstore_name) +{ + conf_entrylist_t *phead = NULL; + conf_entrylist_t *ptr; + conf_entry_t *rtn_entry = NULL; + + if (kstore_name == NULL) + return (NULL); + + if (get_entrylist(&phead) != KMF_OK) + return (NULL); + + ptr = phead; + while (ptr != NULL) { + if (strcmp(ptr->entry->keystore, kstore_name) == 0) + break; + ptr = ptr->next; + } + + if (ptr != NULL) /* found the entry */ + rtn_entry = dup_entry(ptr->entry); + + free_entrylist(phead); + return (rtn_entry); +} |