diff options
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); +} |