17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 56a1073f8Skrishna * Common Development and Distribution License (the "License"). 66a1073f8Skrishna * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22ef56a3c5SKrishna Yenduri * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate /* 277c478bd9Sstevel@tonic-gate * mdb dcmds for selected structures from 287c478bd9Sstevel@tonic-gate * usr/src/uts/common/sys/crypto/spi.h 297c478bd9Sstevel@tonic-gate * 307c478bd9Sstevel@tonic-gate * Also the mdb module housekeeping 317c478bd9Sstevel@tonic-gate */ 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #include <sys/mdb_modapi.h> 347c478bd9Sstevel@tonic-gate #include <sys/modctl.h> 357c478bd9Sstevel@tonic-gate #include <sys/crypto/api.h> 367c478bd9Sstevel@tonic-gate #include <sys/crypto/common.h> 377c478bd9Sstevel@tonic-gate #include <sys/crypto/spi.h> 387c478bd9Sstevel@tonic-gate #include <sys/crypto/impl.h> 397c478bd9Sstevel@tonic-gate #include "crypto_cmds.h" 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate const mdb_bitmask_t extf_flags[] = { 437c478bd9Sstevel@tonic-gate { "NIL", (ulong_t)-1, 0L }, 447c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_RNG", CRYPTO_EXTF_RNG, CRYPTO_EXTF_RNG }, 457c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_WRITE_PROTECTED", CRYPTO_EXTF_WRITE_PROTECTED, 467c478bd9Sstevel@tonic-gate CRYPTO_EXTF_WRITE_PROTECTED }, 477c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_LOGIN_REQUIRED", CRYPTO_EXTF_LOGIN_REQUIRED, 487c478bd9Sstevel@tonic-gate CRYPTO_EXTF_LOGIN_REQUIRED }, 497c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_USER_PIN_INITIALIZED", CRYPTO_EXTF_USER_PIN_INITIALIZED, 507c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_INITIALIZED }, 517c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_CLOCK_ON_TOKEN", CRYPTO_EXTF_CLOCK_ON_TOKEN, 527c478bd9Sstevel@tonic-gate CRYPTO_EXTF_CLOCK_ON_TOKEN }, 537c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_PROTECTED_AUTHENTICATION_PATH", 547c478bd9Sstevel@tonic-gate CRYPTO_EXTF_PROTECTED_AUTHENTICATION_PATH, 557c478bd9Sstevel@tonic-gate CRYPTO_EXTF_PROTECTED_AUTHENTICATION_PATH }, 567c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_DUAL_CRYPTO_OPERATIONS", 577c478bd9Sstevel@tonic-gate CRYPTO_EXTF_DUAL_CRYPTO_OPERATIONS, 587c478bd9Sstevel@tonic-gate CRYPTO_EXTF_DUAL_CRYPTO_OPERATIONS }, 597c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_TOKEN_INITIALIZED", CRYPTO_EXTF_TOKEN_INITIALIZED, 607c478bd9Sstevel@tonic-gate CRYPTO_EXTF_TOKEN_INITIALIZED }, 617c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_USER_PIN_COUNT_LOW", CRYPTO_EXTF_USER_PIN_COUNT_LOW, 627c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_COUNT_LOW }, 637c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_USER_PIN_FINAL_TRY", CRYPTO_EXTF_USER_PIN_FINAL_TRY, 647c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_FINAL_TRY }, 657c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_USER_PIN_LOCKED", CRYPTO_EXTF_USER_PIN_LOCKED, 667c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_LOCKED }, 677c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_USER_PIN_TO_BE_CHANGED", 687c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_TO_BE_CHANGED, 697c478bd9Sstevel@tonic-gate CRYPTO_EXTF_USER_PIN_TO_BE_CHANGED }, 707c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_SO_PIN_COUNT_LOW", CRYPTO_EXTF_SO_PIN_COUNT_LOW, 717c478bd9Sstevel@tonic-gate CRYPTO_EXTF_SO_PIN_COUNT_LOW }, 727c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_SO_PIN_FINAL_TRY", CRYPTO_EXTF_SO_PIN_FINAL_TRY, 737c478bd9Sstevel@tonic-gate CRYPTO_EXTF_SO_PIN_FINAL_TRY }, 747c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_SO_PIN_LOCKED", CRYPTO_EXTF_SO_PIN_LOCKED, 757c478bd9Sstevel@tonic-gate CRYPTO_EXTF_SO_PIN_LOCKED }, 767c478bd9Sstevel@tonic-gate { "CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED", CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED, 777c478bd9Sstevel@tonic-gate CRYPTO_EXTF_SO_PIN_TO_BE_CHANGED }, 787c478bd9Sstevel@tonic-gate { NULL, 0, 0 } 797c478bd9Sstevel@tonic-gate }; 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 827c478bd9Sstevel@tonic-gate int 837c478bd9Sstevel@tonic-gate crypto_provider_ext_info(uintptr_t addr, uint_t flags, int argc, 847c478bd9Sstevel@tonic-gate const mdb_arg_t *argv) 857c478bd9Sstevel@tonic-gate { 867c478bd9Sstevel@tonic-gate crypto_provider_ext_info_t ext_prov; 877c478bd9Sstevel@tonic-gate /* 887c478bd9Sstevel@tonic-gate * 33 is 1 + MAX(CRYPTO_EXT_SIZE_LABEL, CRYPTO_EXT_SIZE_MANUF, 897c478bd9Sstevel@tonic-gate * CRYPTO_EXT_SIZE_MODEL, CRYPTO_EXT_SIZE_SERIAL) 907c478bd9Sstevel@tonic-gate */ 917c478bd9Sstevel@tonic-gate char scratch[33]; 927c478bd9Sstevel@tonic-gate 93*fc10aa48SRichard Lowe if (!(flags & DCMD_ADDRSPEC)) 947c478bd9Sstevel@tonic-gate return (DCMD_USAGE); 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate if (mdb_vread(&ext_prov, sizeof (crypto_provider_ext_info_t), addr) 977c478bd9Sstevel@tonic-gate == -1) { 987c478bd9Sstevel@tonic-gate mdb_warn("cannot read addr"); 997c478bd9Sstevel@tonic-gate return (DCMD_ERR); 1007c478bd9Sstevel@tonic-gate } 1017c478bd9Sstevel@tonic-gate bcopy(ext_prov.ei_label, scratch, CRYPTO_EXT_SIZE_LABEL); 1027c478bd9Sstevel@tonic-gate scratch[CRYPTO_EXT_SIZE_LABEL] = '\0'; 1037c478bd9Sstevel@tonic-gate mdb_printf("ei_label\t\t%s\n", scratch); 1047c478bd9Sstevel@tonic-gate 1057c478bd9Sstevel@tonic-gate bcopy(ext_prov.ei_manufacturerID, scratch, CRYPTO_EXT_SIZE_MANUF); 1067c478bd9Sstevel@tonic-gate scratch[CRYPTO_EXT_SIZE_MANUF] = '\0'; 1077c478bd9Sstevel@tonic-gate mdb_printf("ei_manufacturerID\t%s\n", scratch); 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate bcopy(ext_prov.ei_model, scratch, CRYPTO_EXT_SIZE_MODEL); 1107c478bd9Sstevel@tonic-gate scratch[CRYPTO_EXT_SIZE_MODEL] = '\0'; 1117c478bd9Sstevel@tonic-gate mdb_printf("ei_model\t\t%s\n", scratch); 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate bcopy(ext_prov.ei_serial_number, scratch, CRYPTO_EXT_SIZE_SERIAL); 1147c478bd9Sstevel@tonic-gate scratch[CRYPTO_EXT_SIZE_SERIAL] = '\0'; 1157c478bd9Sstevel@tonic-gate mdb_printf("ei_serial_number\t%s\n", scratch); 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate mdb_printf("ei_flags\t0x%x:\t<%lb>\n", ext_prov.ei_flags, 1187c478bd9Sstevel@tonic-gate ext_prov.ei_flags, extf_flags); 1197c478bd9Sstevel@tonic-gate mdb_printf("ei_max_session_count\t%lu\n", 1207c478bd9Sstevel@tonic-gate ext_prov.ei_max_session_count); 1217c478bd9Sstevel@tonic-gate mdb_printf("ei_max_pin_len\t\t%lu\n", ext_prov.ei_max_pin_len); 1227c478bd9Sstevel@tonic-gate mdb_printf("ei_min_pin_len\t\t%lu\n", ext_prov.ei_min_pin_len); 1237c478bd9Sstevel@tonic-gate mdb_printf("ei_total_public_memory\t%lu\n", 1247c478bd9Sstevel@tonic-gate ext_prov.ei_total_public_memory); 1257c478bd9Sstevel@tonic-gate mdb_printf("ei_free_public_memory\t%lu\n", 1267c478bd9Sstevel@tonic-gate ext_prov.ei_free_public_memory); 1277c478bd9Sstevel@tonic-gate mdb_printf("ei_total_private_memory\t%lu\n", 1287c478bd9Sstevel@tonic-gate ext_prov.ei_total_private_memory); 1297c478bd9Sstevel@tonic-gate mdb_printf("ei_free_private_memory\t%lu\n", 1307c478bd9Sstevel@tonic-gate ext_prov.ei_free_private_memory); 1317c478bd9Sstevel@tonic-gate mdb_printf("ei_hardware_version\tmajor %c minor %c\n", 1327c478bd9Sstevel@tonic-gate ext_prov.ei_hardware_version.cv_major, 1337c478bd9Sstevel@tonic-gate ext_prov.ei_hardware_version.cv_minor); 1347c478bd9Sstevel@tonic-gate mdb_printf("ei_firmware_version\tmajor %c minor %c\n", 1357c478bd9Sstevel@tonic-gate ext_prov.ei_firmware_version.cv_major, 1367c478bd9Sstevel@tonic-gate ext_prov.ei_firmware_version.cv_minor); 1377c478bd9Sstevel@tonic-gate mdb_printf("ei_time\t%s\n", ext_prov.ei_time); 1387c478bd9Sstevel@tonic-gate return (DCMD_OK); 1397c478bd9Sstevel@tonic-gate } 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate const mdb_bitmask_t mech_bits[] = { 1427c478bd9Sstevel@tonic-gate { "NIL", (uint32_t)-1, 0 }, 1437c478bd9Sstevel@tonic-gate { "CRYPTO_FG_ENCRYPT", CRYPTO_FG_ENCRYPT, CRYPTO_FG_ENCRYPT }, 1447c478bd9Sstevel@tonic-gate { "CRYPTO_FG_DECRYPT", CRYPTO_FG_DECRYPT, CRYPTO_FG_DECRYPT }, 1457c478bd9Sstevel@tonic-gate { "CRYPTO_FG_DIGEST", CRYPTO_FG_DIGEST, CRYPTO_FG_DIGEST }, 1467c478bd9Sstevel@tonic-gate { "CRYPTO_FG_SIGN", CRYPTO_FG_SIGN, CRYPTO_FG_SIGN }, 1477c478bd9Sstevel@tonic-gate { "CRYPTO_FG_SIGN_RECOVER", CRYPTO_FG_SIGN_RECOVER, 1487c478bd9Sstevel@tonic-gate CRYPTO_FG_SIGN_RECOVER }, 1497c478bd9Sstevel@tonic-gate { "CRYPTO_FG_VERIFY", CRYPTO_FG_VERIFY, CRYPTO_FG_VERIFY }, 1507c478bd9Sstevel@tonic-gate { "CRYPTO_FG_VERIFY_RECOVER", CRYPTO_FG_VERIFY_RECOVER, 1517c478bd9Sstevel@tonic-gate CRYPTO_FG_VERIFY_RECOVER }, 1527c478bd9Sstevel@tonic-gate { "CRYPTO_FG_GENERATE", CRYPTO_FG_GENERATE, CRYPTO_FG_GENERATE }, 1537c478bd9Sstevel@tonic-gate { "CRYPTO_FG_GENERATE_KEY_PAIR", CRYPTO_FG_GENERATE_KEY_PAIR, 1547c478bd9Sstevel@tonic-gate CRYPTO_FG_GENERATE_KEY_PAIR }, 1557c478bd9Sstevel@tonic-gate { "CRYPTO_FG_WRAP", CRYPTO_FG_WRAP, CRYPTO_FG_WRAP }, 1567c478bd9Sstevel@tonic-gate { "CRYPTO_FG_UNWRAP", CRYPTO_FG_UNWRAP, CRYPTO_FG_UNWRAP }, 1577c478bd9Sstevel@tonic-gate { "CRYPTO_FG_DERIVE", CRYPTO_FG_DERIVE, CRYPTO_FG_DERIVE }, 1587c478bd9Sstevel@tonic-gate { "CRYPTO_FG_MAC", CRYPTO_FG_MAC, CRYPTO_FG_MAC }, 1597c478bd9Sstevel@tonic-gate { "CRYPTO_FG_ENCRYPT_MAC", CRYPTO_FG_ENCRYPT_MAC, 1607c478bd9Sstevel@tonic-gate CRYPTO_FG_ENCRYPT_MAC }, 1617c478bd9Sstevel@tonic-gate { "CRYPTO_FG_MAC_DECRYPT", CRYPTO_FG_MAC_DECRYPT, 1627c478bd9Sstevel@tonic-gate CRYPTO_FG_MAC_DECRYPT }, 1637c478bd9Sstevel@tonic-gate { "CRYPTO_FG_ENCRYPT_ATOMIC", CRYPTO_FG_ENCRYPT_ATOMIC, 1647c478bd9Sstevel@tonic-gate CRYPTO_FG_ENCRYPT_ATOMIC }, 1657c478bd9Sstevel@tonic-gate { "CRYPTO_FG_DECRYPT_ATOMIC", CRYPTO_FG_DECRYPT_ATOMIC, 1667c478bd9Sstevel@tonic-gate CRYPTO_FG_DECRYPT_ATOMIC }, 1677c478bd9Sstevel@tonic-gate { "CRYPTO_FG_MAC_ATOMIC", CRYPTO_FG_MAC_ATOMIC, CRYPTO_FG_MAC_ATOMIC }, 1687c478bd9Sstevel@tonic-gate { "CRYPTO_FG_DIGEST_ATOMIC", CRYPTO_FG_DIGEST_ATOMIC, 1697c478bd9Sstevel@tonic-gate CRYPTO_FG_DIGEST_ATOMIC }, 1707c478bd9Sstevel@tonic-gate { "CRYPTO_FG_SIGN_ATOMIC", CRYPTO_FG_SIGN_ATOMIC, 1717c478bd9Sstevel@tonic-gate CRYPTO_FG_SIGN_ATOMIC }, 1727c478bd9Sstevel@tonic-gate { "CRYPTO_FG_SIGN_RECOVER_ATOMIC", CRYPTO_FG_SIGN_RECOVER_ATOMIC, 1737c478bd9Sstevel@tonic-gate CRYPTO_FG_SIGN_RECOVER_ATOMIC }, 1747c478bd9Sstevel@tonic-gate { "CRYPTO_FG_VERIFY_ATOMIC", CRYPTO_FG_VERIFY_ATOMIC, 1757c478bd9Sstevel@tonic-gate CRYPTO_FG_VERIFY_ATOMIC }, 1767c478bd9Sstevel@tonic-gate { "CRYPTO_FG_VERIFY_RECOVER_ATOMIC", CRYPTO_FG_VERIFY_RECOVER_ATOMIC, 1777c478bd9Sstevel@tonic-gate CRYPTO_FG_VERIFY_RECOVER_ATOMIC }, 1787c478bd9Sstevel@tonic-gate { "CRYPTO_FG_ENCRYPT_MAC_ATOMIC", CRYPTO_FG_ENCRYPT_MAC_ATOMIC, 1797c478bd9Sstevel@tonic-gate CRYPTO_FG_ENCRYPT_MAC_ATOMIC }, 1807c478bd9Sstevel@tonic-gate { "CRYPTO_FG_MAC_DECRYPT_ATOMIC", CRYPTO_FG_MAC_DECRYPT_ATOMIC, 1817c478bd9Sstevel@tonic-gate CRYPTO_FG_MAC_DECRYPT_ATOMIC }, 1827c478bd9Sstevel@tonic-gate { "CRYPTO_FG_RANDOM", CRYPTO_FG_RANDOM, CRYPTO_FG_RANDOM}, 1837c478bd9Sstevel@tonic-gate { NULL, 0, 0 } 1847c478bd9Sstevel@tonic-gate }; 1857c478bd9Sstevel@tonic-gate 1867c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 1877c478bd9Sstevel@tonic-gate int 1887c478bd9Sstevel@tonic-gate crypto_mech_info(uintptr_t addr, uint_t flags, int argc, 1897c478bd9Sstevel@tonic-gate const mdb_arg_t *argv) 1907c478bd9Sstevel@tonic-gate { 1917c478bd9Sstevel@tonic-gate crypto_mech_info_t minfo; 1927c478bd9Sstevel@tonic-gate const char *unit = "bits"; 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gate if (! flags & DCMD_ADDRSPEC) 1957c478bd9Sstevel@tonic-gate return (DCMD_USAGE); 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate if (mdb_vread(&minfo, sizeof (crypto_mech_info_t), addr) 1987c478bd9Sstevel@tonic-gate == -1) { 1997c478bd9Sstevel@tonic-gate mdb_warn("cannot read addr %p", addr); 2007c478bd9Sstevel@tonic-gate return (DCMD_ERR); 2017c478bd9Sstevel@tonic-gate } 2027c478bd9Sstevel@tonic-gate mdb_printf("cm_mech_name_t\t%s\n", minfo.cm_mech_name); 2037c478bd9Sstevel@tonic-gate mdb_printf("cm_mech_number\t%lld\n", minfo.cm_mech_number); 2047c478bd9Sstevel@tonic-gate mdb_printf("cm_func_group_mask\t0x%x:\t<%b>\n", 2057c478bd9Sstevel@tonic-gate minfo.cm_func_group_mask, minfo.cm_func_group_mask, mech_bits); 2066a1073f8Skrishna if (minfo.cm_keysize_unit & CRYPTO_KEYSIZE_UNIT_IN_BYTES) 2077c478bd9Sstevel@tonic-gate unit = "bytes"; 2087c478bd9Sstevel@tonic-gate mdb_printf("cm_min_key_length\t%lu %s\n", minfo.cm_min_key_length, 2097c478bd9Sstevel@tonic-gate unit); 2107c478bd9Sstevel@tonic-gate mdb_printf("cm_max_key_length\t%lu %s\n", minfo.cm_max_key_length, 2117c478bd9Sstevel@tonic-gate unit); 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate return (DCMD_OK); 2147c478bd9Sstevel@tonic-gate } 2157c478bd9Sstevel@tonic-gate 2167c478bd9Sstevel@tonic-gate /* 2177c478bd9Sstevel@tonic-gate * MDB module linkage information: 2187c478bd9Sstevel@tonic-gate * 2197c478bd9Sstevel@tonic-gate * We declare a list of structures describing our dcmds, and a function 2207c478bd9Sstevel@tonic-gate * named _mdb_init to return a pointer to our module information. 2217c478bd9Sstevel@tonic-gate */ 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate static const mdb_dcmd_t dcmds[] = { 2247c478bd9Sstevel@tonic-gate 2257c478bd9Sstevel@tonic-gate /* spi.c */ 2267c478bd9Sstevel@tonic-gate { "crypto_provider_ext_info", ":", 2277c478bd9Sstevel@tonic-gate "module-private crypto provider info", 2287c478bd9Sstevel@tonic-gate crypto_provider_ext_info, NULL }, 2297c478bd9Sstevel@tonic-gate { "crypto_mech_info", ":", 2307c478bd9Sstevel@tonic-gate "print as crypto_mech_info", 2317c478bd9Sstevel@tonic-gate crypto_mech_info, NULL }, 2327c478bd9Sstevel@tonic-gate 2337c478bd9Sstevel@tonic-gate /* common.c */ 2347c478bd9Sstevel@tonic-gate { "crypto_mechanism", ":", 2357c478bd9Sstevel@tonic-gate "details about a crypto mechanism", crypto_mechanism, NULL }, 2367c478bd9Sstevel@tonic-gate { "crypto_data", ":", 2377c478bd9Sstevel@tonic-gate "print as crypto_data", 2387c478bd9Sstevel@tonic-gate crypto_data, NULL }, 2397c478bd9Sstevel@tonic-gate { "crypto_dual_data", ":", 2407c478bd9Sstevel@tonic-gate "print as crypto_dual_data", 2417c478bd9Sstevel@tonic-gate crypto_dual_data, NULL }, 2427c478bd9Sstevel@tonic-gate { "crypto_key", ":", 2437c478bd9Sstevel@tonic-gate "print as crypto_key", crypto_key, NULL }, 2447c478bd9Sstevel@tonic-gate 2457c478bd9Sstevel@tonic-gate 2467c478bd9Sstevel@tonic-gate /* impl.c */ 2477c478bd9Sstevel@tonic-gate { "kcf_provider_desc", ":", 2487c478bd9Sstevel@tonic-gate "crypto provider description struct", kcf_provider_desc, NULL }, 2497c478bd9Sstevel@tonic-gate 2507c478bd9Sstevel@tonic-gate { "prov_tab", "", 2517c478bd9Sstevel@tonic-gate "global table of crypto providers ", prov_tab, NULL }, 2527c478bd9Sstevel@tonic-gate 2537c478bd9Sstevel@tonic-gate { "policy_tab", "", 2547c478bd9Sstevel@tonic-gate "print global policy_tab", policy_tab, NULL }, 2557c478bd9Sstevel@tonic-gate 2567c478bd9Sstevel@tonic-gate /* sched_impl.c */ 2577c478bd9Sstevel@tonic-gate { "kcf_areq_node", ":[-v]", 2587c478bd9Sstevel@tonic-gate "print asynchronous crypto request struct, [ verbose ]", 2597c478bd9Sstevel@tonic-gate kcf_areq_node, NULL }, 2607c478bd9Sstevel@tonic-gate 2617c478bd9Sstevel@tonic-gate { "kcf_global_swq", "?[-v]", 2627c478bd9Sstevel@tonic-gate "global or addr global crypto queue. [ -v = verbose ]", 2637c478bd9Sstevel@tonic-gate kcf_global_swq, NULL }, 2647c478bd9Sstevel@tonic-gate { "crypto_find_reqid", "?[-v] reqid", 2657c478bd9Sstevel@tonic-gate "look for reqid, print if found [ -v = verbose ]", 2667c478bd9Sstevel@tonic-gate crypto_find_reqid, NULL }, 2677c478bd9Sstevel@tonic-gate 2687c478bd9Sstevel@tonic-gate { "kcf_reqid_table", ":[-v]", 2697c478bd9Sstevel@tonic-gate "print contents of a request ID hash table [ -v = verbose ]", 2707c478bd9Sstevel@tonic-gate kcf_reqid_table_dcmd, NULL }, 2717c478bd9Sstevel@tonic-gate 2727c478bd9Sstevel@tonic-gate { "kcf_soft_conf_entry", "?", 2737c478bd9Sstevel@tonic-gate "head or addr of configured software crypto providers", 2747c478bd9Sstevel@tonic-gate kcf_soft_conf_entry, NULL }, 2757c478bd9Sstevel@tonic-gate 2767c478bd9Sstevel@tonic-gate { "kcf_policy_desc", ":", "policy descriptors for crypto", 2777c478bd9Sstevel@tonic-gate kcf_policy_desc, NULL }, 2787c478bd9Sstevel@tonic-gate { NULL } 2797c478bd9Sstevel@tonic-gate }; 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate static const mdb_walker_t walkers[] = { 2827c478bd9Sstevel@tonic-gate { "an_next", "walk kcf_areq_node's by an_next", 2837c478bd9Sstevel@tonic-gate areq_first_walk_init, an_next_walk_step, areq_walk_fini }, 2847c478bd9Sstevel@tonic-gate { "an_prev", "walk kcf_areq_node's by an_prev", 2857c478bd9Sstevel@tonic-gate areq_last_walk_init, an_prev_walk_step, areq_walk_fini }, 2867c478bd9Sstevel@tonic-gate { "an_idnext", "walk kcf_areq_node's by an_idnext", 2877c478bd9Sstevel@tonic-gate an_idnext_walk_init, an_idnext_walk_step, areq_walk_fini }, 2887c478bd9Sstevel@tonic-gate { "an_idprev", "walk kcf_areq_node's by an_idprev", 2897c478bd9Sstevel@tonic-gate an_idprev_walk_init, an_idprev_walk_step, areq_walk_fini }, 2907c478bd9Sstevel@tonic-gate { "an_ctxchain_next", 2917c478bd9Sstevel@tonic-gate "walk kcf_areq_node's by an_ctxchain_next", 2927c478bd9Sstevel@tonic-gate an_ctxchain_walk_init, an_ctxchain_walk_step, areq_walk_fini }, 2937c478bd9Sstevel@tonic-gate { "kcf_reqid_table", "table of asynchronous crypto requests", 2947c478bd9Sstevel@tonic-gate reqid_table_walk_init, reqid_table_walk_step, 2957c478bd9Sstevel@tonic-gate reqid_table_walk_fini }, 2967c478bd9Sstevel@tonic-gate { "soft_conf_entry", "table of software providers or addr", 2977c478bd9Sstevel@tonic-gate soft_conf_walk_init, soft_conf_walk_step, 2987c478bd9Sstevel@tonic-gate soft_conf_walk_fini }, 2997c478bd9Sstevel@tonic-gate { NULL } 3007c478bd9Sstevel@tonic-gate }; 3017c478bd9Sstevel@tonic-gate 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate static const mdb_modinfo_t modinfo = { 3047c478bd9Sstevel@tonic-gate MDB_API_VERSION, dcmds, walkers 3057c478bd9Sstevel@tonic-gate }; 3067c478bd9Sstevel@tonic-gate 3077c478bd9Sstevel@tonic-gate const mdb_modinfo_t * 3087c478bd9Sstevel@tonic-gate _mdb_init(void) 3097c478bd9Sstevel@tonic-gate { 3107c478bd9Sstevel@tonic-gate return (&modinfo); 3117c478bd9Sstevel@tonic-gate } 312