67 CK_RV (*Tmp_C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR);
68 CK_FUNCTION_LIST_PTR funcs;
69 void *dldesc = NULL;
70 boolean_t lib_initialized = B_FALSE;
71 uentry_t *puent;
72 char buf[128];
73
74
75 /*
76 * Display the system-wide metaslot settings as specified
77 * in pkcs11.conf file.
78 */
79 if ((puent = getent_uef(METASLOT_KEYWORD)) == NULL) {
80 cryptoerror(LOG_STDERR,
81 gettext("metaslot entry doesn't exist."));
82 return (FAILURE);
83 }
84
85 (void) printf(gettext("System-wide Meta Slot Configuration:\n"));
86 /*
87 * TRANSLATION_NOTE:
88 * Strictly for appearance's sake, this line should be as long as
89 * the length of the translated text above.
90 */
91 (void) printf(gettext("------------------------------------\n"));
92 (void) printf(gettext("Status: %s\n"), puent->flag_metaslot_enabled ?
93 gettext("enabled") : gettext("disabled"));
94 (void) printf(gettext("Sensitive Token Object Automatic Migrate: %s\n"),
95 puent->flag_metaslot_auto_key_migrate ? gettext("enabled") :
96 gettext("disabled"));
97
98 bzero(buf, sizeof (buf));
99 if (memcmp(puent->metaslot_ks_slot, buf, SLOT_DESCRIPTION_SIZE) != 0) {
100 (void) printf(gettext("Persistent object store slot: %s\n"),
101 puent->metaslot_ks_slot);
102 }
103
104 if (memcmp(puent->metaslot_ks_token, buf, TOKEN_LABEL_SIZE) != 0) {
105 (void) printf(gettext("Persistent object store token: %s\n"),
106 puent->metaslot_ks_token);
107 }
108
109 if ((!verbose) && (!show_mechs)) {
110 return (SUCCESS);
111 }
112
113 if (verbose) {
114 (void) printf(gettext("\nDetailed Meta Slot Information:\n"));
115 /*
116 * TRANSLATION_NOTE:
117 * Strictly for appearance's sake, this line should be as
118 * long as the length of the translated text above.
119 */
120 (void) printf(gettext("-------------------------------\n"));
121 }
122
123 /*
124 * Need to actually make calls to libpkcs11.so to get
125 * information about metaslot.
126 */
127
128 dldesc = dlopen(UEF_FRAME_LIB, RTLD_NOW);
129 if (dldesc == NULL) {
130 char *dl_error;
131 dl_error = dlerror();
132 cryptodebug("Cannot load PKCS#11 framework library. "
133 "dlerror:%s", dl_error);
134 return (FAILURE);
135 }
136
|
67 CK_RV (*Tmp_C_GetFunctionList)(CK_FUNCTION_LIST_PTR_PTR);
68 CK_FUNCTION_LIST_PTR funcs;
69 void *dldesc = NULL;
70 boolean_t lib_initialized = B_FALSE;
71 uentry_t *puent;
72 char buf[128];
73
74
75 /*
76 * Display the system-wide metaslot settings as specified
77 * in pkcs11.conf file.
78 */
79 if ((puent = getent_uef(METASLOT_KEYWORD)) == NULL) {
80 cryptoerror(LOG_STDERR,
81 gettext("metaslot entry doesn't exist."));
82 return (FAILURE);
83 }
84
85 (void) printf(gettext("System-wide Meta Slot Configuration:\n"));
86 /*
87 * TRANSLATION_NOTE
88 * Strictly for appearance's sake, this line should be as long as
89 * the length of the translated text above.
90 */
91 (void) printf(gettext("------------------------------------\n"));
92 (void) printf(gettext("Status: %s\n"), puent->flag_metaslot_enabled ?
93 gettext("enabled") : gettext("disabled"));
94 (void) printf(gettext("Sensitive Token Object Automatic Migrate: %s\n"),
95 puent->flag_metaslot_auto_key_migrate ? gettext("enabled") :
96 gettext("disabled"));
97
98 bzero(buf, sizeof (buf));
99 if (memcmp(puent->metaslot_ks_slot, buf, SLOT_DESCRIPTION_SIZE) != 0) {
100 (void) printf(gettext("Persistent object store slot: %s\n"),
101 puent->metaslot_ks_slot);
102 }
103
104 if (memcmp(puent->metaslot_ks_token, buf, TOKEN_LABEL_SIZE) != 0) {
105 (void) printf(gettext("Persistent object store token: %s\n"),
106 puent->metaslot_ks_token);
107 }
108
109 if ((!verbose) && (!show_mechs)) {
110 return (SUCCESS);
111 }
112
113 if (verbose) {
114 (void) printf(gettext("\nDetailed Meta Slot Information:\n"));
115 /*
116 * TRANSLATION_NOTE
117 * Strictly for appearance's sake, this line should be as
118 * long as the length of the translated text above.
119 */
120 (void) printf(gettext("-------------------------------\n"));
121 }
122
123 /*
124 * Need to actually make calls to libpkcs11.so to get
125 * information about metaslot.
126 */
127
128 dldesc = dlopen(UEF_FRAME_LIB, RTLD_NOW);
129 if (dldesc == NULL) {
130 char *dl_error;
131 dl_error = dlerror();
132 cryptodebug("Cannot load PKCS#11 framework library. "
133 "dlerror:%s", dl_error);
134 return (FAILURE);
135 }
136
|