Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
yubihsm.h
Go to the documentation of this file.
1/*
2 * Copyright 2015-2018 Yubico AB
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
80#ifndef YUBIHSM_H
81#define YUBIHSM_H
82
83#include <stdint.h>
84#include <stdbool.h>
85#include <stddef.h>
86#include <stdio.h>
87
89#define YH_CONTEXT_LEN 16
91#define YH_HOST_CHAL_LEN 8
93#define YH_MSG_BUF_SIZE 2048
95#define YH_KEY_LEN 16
97#define YH_VID 0x1050
99#define YH_PID 0x0030
101#define YH_CMD_RESP_FLAG 0x80
103#define YH_MAX_ITEMS_COUNT 256
105#define YH_MAX_SESSIONS 16
107#define YH_DEFAULT_ENC_KEY \
108 "\x09\x0b\x47\xdb\xed\x59\x56\x54\x90\x1d\xee\x1c\xc6\x55\xe4\x20"
110#define YH_DEFAULT_MAC_KEY \
111 "\x59\x2f\xd4\x83\xf7\x59\xe2\x99\x09\xa0\x4c\x45\x05\xd2\xce\x0a"
113#define YH_DEFAULT_PASSWORD "password"
115#define YH_DEFAULT_SALT "Yubico"
117#define YH_DEFAULT_ITERS 10000
119#define YH_CAPABILITIES_LEN 8
121#define YH_MAX_LOG_ENTRIES 64
123#define YH_OBJ_LABEL_LEN 40
125#define YH_MAX_DOMAINS 16
127#define YH_LOG_DIGEST_SIZE 16
129#define YH_USB_URL_SCHEME "yhusb://"
130
131// Debug levels
133#define YH_VERB_QUIET 0x00
135#define YH_VERB_INTERMEDIATE 0x01
137#define YH_VERB_CRYPTO 0x02
139#define YH_VERB_RAW 0x04
141#define YH_VERB_INFO 0x08
143#define YH_VERB_ERR 0x10
145#define YH_VERB_ALL 0xff
146
149#define YH_CCM_WRAP_OVERHEAD (1 + 13 + 16)
150
151#ifdef __cplusplus
152extern "C" {
153#endif
154
157
159typedef struct yh_session yh_session;
160
166
236
238#define ADD_COMMAND(c, v) c = v, c##_R = v | YH_CMD_RESP_FLAG
239
243typedef enum {
245 ADD_COMMAND(YHC_ECHO, 0x01),
247 ADD_COMMAND(YHC_CREATE_SESSION, 0x03),
249 ADD_COMMAND(YHC_AUTHENTICATE_SESSION, 0x04),
251 ADD_COMMAND(YHC_SESSION_MESSAGE, 0x05),
253 ADD_COMMAND(YHC_GET_DEVICE_INFO, 0x06),
255 ADD_COMMAND(YHC_RESET_DEVICE, 0x08),
257 ADD_COMMAND(YHC_CLOSE_SESSION, 0x40),
259 ADD_COMMAND(YHC_GET_STORAGE_INFO, 0x041),
261 ADD_COMMAND(YHC_PUT_OPAQUE, 0x42),
263 ADD_COMMAND(YHC_GET_OPAQUE, 0x43),
265 ADD_COMMAND(YHC_PUT_AUTHENTICATION_KEY, 0x44),
267 ADD_COMMAND(YHC_PUT_ASYMMETRIC_KEY, 0x45),
269 ADD_COMMAND(YHC_GENERATE_ASYMMETRIC_KEY, 0x46),
271 ADD_COMMAND(YHC_SIGN_PKCS1, 0x47),
273 ADD_COMMAND(YHC_LIST_OBJECTS, 0x48),
275 ADD_COMMAND(YHC_DECRYPT_PKCS1, 0x49),
277 ADD_COMMAND(YHC_EXPORT_WRAPPED, 0x4a),
279 ADD_COMMAND(YHC_IMPORT_WRAPPED, 0x4b),
281 ADD_COMMAND(YHC_PUT_WRAP_KEY, 0x4c),
283 ADD_COMMAND(YHC_GET_LOG_ENTRIES, 0x4d),
285 ADD_COMMAND(YHC_GET_OBJECT_INFO, 0x4e),
287 ADD_COMMAND(YHC_SET_OPTION, 0x4f),
289 ADD_COMMAND(YHC_GET_OPTION, 0x50),
291 ADD_COMMAND(YHC_GET_PSEUDO_RANDOM, 0x51),
293 ADD_COMMAND(YHC_PUT_HMAC_KEY, 0x52),
295 ADD_COMMAND(YHC_SIGN_HMAC, 0x53),
297 ADD_COMMAND(YHC_GET_PUBLIC_KEY, 0x54),
299 ADD_COMMAND(YHC_SIGN_PSS, 0x55),
301 ADD_COMMAND(YHC_SIGN_ECDSA, 0x56),
303 ADD_COMMAND(YHC_DERIVE_ECDH, 0x57),
305 ADD_COMMAND(YHC_DELETE_OBJECT, 0x58),
307 ADD_COMMAND(YHC_DECRYPT_OAEP, 0x59),
309 ADD_COMMAND(YHC_GENERATE_HMAC_KEY, 0x5a),
311 ADD_COMMAND(YHC_GENERATE_WRAP_KEY, 0x5b),
313 ADD_COMMAND(YHC_VERIFY_HMAC, 0x5c),
315 ADD_COMMAND(YHC_SIGN_SSH_CERTIFICATE, 0x5d),
317 ADD_COMMAND(YHC_PUT_TEMPLATE, 0x5e),
319 ADD_COMMAND(YHC_GET_TEMPLATE, 0x5f),
321 ADD_COMMAND(YHC_DECRYPT_OTP, 0x60),
323 ADD_COMMAND(YHC_CREATE_OTP_AEAD, 0x61),
325 ADD_COMMAND(YHC_RANDOMIZE_OTP_AEAD, 0x62),
327 ADD_COMMAND(YHC_REWRAP_OTP_AEAD, 0x63),
329 ADD_COMMAND(YHC_SIGN_ATTESTATION_CERTIFICATE, 0x64),
331 ADD_COMMAND(YHC_PUT_OTP_AEAD_KEY, 0x65),
333 ADD_COMMAND(YHC_GENERATE_OTP_AEAD_KEY, 0x66),
335 ADD_COMMAND(YHC_SET_LOG_INDEX, 0x67),
337 ADD_COMMAND(YHC_WRAP_DATA, 0x68),
339 ADD_COMMAND(YHC_UNWRAP_DATA, 0x69),
341 ADD_COMMAND(YHC_SIGN_EDDSA, 0x6a),
343 ADD_COMMAND(YHC_BLINK_DEVICE, 0x6b),
345 ADD_COMMAND(YHC_CHANGE_AUTHENTICATION_KEY, 0x6c),
348 YHC_ERROR = 0x7f,
349} yh_cmd;
350
351#undef ADD_COMMAND
352
381
383#define YH_MAX_ALGORITHM_COUNT 0xff
390typedef enum {
486
496
508
509#pragma pack(push, 1)
536
562#pragma pack(pop)
563
564static const struct {
565 const char *name;
566 int bit;
567} yh_capability[] = {
568 {"change-authentication-key", 0x2e},
569 {"create-otp-aead", 0x1e},
570 {"decrypt-oaep", 0x0a},
571 {"decrypt-otp", 0x1d},
572 {"decrypt-pkcs", 0x09},
573 {"delete-asymmetric-key", 0x29},
574 {"delete-authentication-key", 0x28},
575 {"delete-hmac-key", 0x2b},
576 {"delete-opaque", 0x27},
577 {"delete-otp-aead-key", 0x2d},
578 {"delete-template", 0x2c},
579 {"delete-wrap-key", 0x2a},
580 {"derive-ecdh", 0x0b},
581 {"export-wrapped", 0x0c},
582 {"exportable-under-wrap", 0x10},
583 {"generate-asymmetric-key", 0x04},
584 {"generate-hmac-key", 0x15},
585 {"generate-otp-aead-key", 0x24},
586 {"generate-wrap-key", 0x0f},
587 {"get-log-entries", 0x18},
588 {"get-opaque", 0x00},
589 {"get-option", 0x12},
590 {"get-pseudo-random", 0x13},
591 {"get-template", 0x1a},
592 {"import-wrapped", 0x0d},
593 {"put-asymmetric-key", 0x03},
594 {"put-authentication-key", 0x02},
595 {"put-mac-key", 0x14},
596 {"put-opaque", 0x01},
597 {"put-otp-aead-key", 0x23},
598 {"put-template", 0x1b},
599 {"put-wrap-key", 0x0e},
600 {"randomize-otp-aead", 0x1f},
601 {"reset-device", 0x1c},
602 {"rewrap-from-otp-aead-key", 0x20},
603 {"rewrap-to-otp-aead-key", 0x21},
604 {"set-option", 0x11},
605 {"sign-attestation-certificate", 0x22},
606 {"sign-ecdsa", 0x07},
607 {"sign-eddsa", 0x08},
608 {"sign-hmac", 0x16},
609 {"sign-pkcs", 0x05},
610 {"sign-pss", 0x06},
611 {"sign-ssh-certificate", 0x19},
612 {"unwrap-data", 0x26},
613 {"verify-hmac", 0x17},
614 {"wrap-data", 0x25},
615};
616
617static const struct {
618 const char *name;
620} yh_algorithms[] = {
621 {"aes128-ccm-wrap", YH_ALGO_AES128_CCM_WRAP},
622 {"aes128-yubico-authentication", YH_ALGO_AES128_YUBICO_AUTHENTICATION},
623 {"aes128-yubico-otp", YH_ALGO_AES128_YUBICO_OTP},
624 {"aes192-ccm-wrap", YH_ALGO_AES192_CCM_WRAP},
625 {"aes192-yubico-otp", YH_ALGO_AES192_YUBICO_OTP},
626 {"aes256-ccm-wrap", YH_ALGO_AES256_CCM_WRAP},
627 {"aes256-yubico-otp", YH_ALGO_AES256_YUBICO_OTP},
628 {"ecbp256", YH_ALGO_EC_BP256},
629 {"ecbp384", YH_ALGO_EC_BP384},
630 {"ecbp512", YH_ALGO_EC_BP512},
631 {"ecdh", YH_ALGO_EC_ECDH},
632 {"ecdsa-sha1", YH_ALGO_EC_ECDSA_SHA1},
633 {"ecdsa-sha256", YH_ALGO_EC_ECDSA_SHA256},
634 {"ecdsa-sha384", YH_ALGO_EC_ECDSA_SHA384},
635 {"ecdsa-sha512", YH_ALGO_EC_ECDSA_SHA512},
636 {"eck256", YH_ALGO_EC_K256},
637 {"ecp224", YH_ALGO_EC_P224},
638 {"ecp256", YH_ALGO_EC_P256},
639 {"ecp384", YH_ALGO_EC_P384},
640 {"ecp521", YH_ALGO_EC_P521},
641 {"ed25519", YH_ALGO_EC_ED25519},
642 {"hmac-sha1", YH_ALGO_HMAC_SHA1},
643 {"hmac-sha256", YH_ALGO_HMAC_SHA256},
644 {"hmac-sha384", YH_ALGO_HMAC_SHA384},
645 {"hmac-sha512", YH_ALGO_HMAC_SHA512},
646 {"mgf1-sha1", YH_ALGO_MGF1_SHA1},
647 {"mgf1-sha256", YH_ALGO_MGF1_SHA256},
648 {"mgf1-sha384", YH_ALGO_MGF1_SHA384},
649 {"mgf1-sha512", YH_ALGO_MGF1_SHA512},
650 {"opaque-data", YH_ALGO_OPAQUE_DATA},
651 {"opaque-x509-certificate", YH_ALGO_OPAQUE_X509_CERTIFICATE},
652 {"rsa-oaep-sha1", YH_ALGO_RSA_OAEP_SHA1},
653 {"rsa-oaep-sha256", YH_ALGO_RSA_OAEP_SHA256},
654 {"rsa-oaep-sha384", YH_ALGO_RSA_OAEP_SHA384},
655 {"rsa-oaep-sha512", YH_ALGO_RSA_OAEP_SHA512},
656 {"rsa-pkcs1-sha1", YH_ALGO_RSA_PKCS1_SHA1},
657 {"rsa-pkcs1-sha256", YH_ALGO_RSA_PKCS1_SHA256},
658 {"rsa-pkcs1-sha384", YH_ALGO_RSA_PKCS1_SHA384},
659 {"rsa-pkcs1-sha512", YH_ALGO_RSA_PKCS1_SHA512},
660 {"rsa-pss-sha1", YH_ALGO_RSA_PSS_SHA1},
661 {"rsa-pss-sha256", YH_ALGO_RSA_PSS_SHA256},
662 {"rsa-pss-sha384", YH_ALGO_RSA_PSS_SHA384},
663 {"rsa-pss-sha512", YH_ALGO_RSA_PSS_SHA512},
664 {"rsa2048", YH_ALGO_RSA_2048},
665 {"rsa3072", YH_ALGO_RSA_3072},
666 {"rsa4096", YH_ALGO_RSA_4096},
667 {"template-ssh", YH_ALGO_TEMPLATE_SSH},
668};
669
670static const struct {
671 const char *name;
673} yh_types[] = {
674 {"authentication-key", YH_AUTHENTICATION_KEY},
675 {"asymmetric-key", YH_ASYMMETRIC_KEY},
676 {"hmac-key", YH_HMAC_KEY},
677 {"opaque", YH_OPAQUE},
678 {"otp-aead-key", YH_OTP_AEAD_KEY},
679 {"template", YH_TEMPLATE},
680 {"wrap-key", YH_WRAP_KEY},
681};
682
683static const struct {
684 const char *name;
686} yh_options[] = {
687 {"command-audit", YH_OPTION_COMMAND_AUDIT},
688 {"force-audit", YH_OPTION_FORCE_AUDIT},
689};
690
692#define YH_ORIGIN_GENERATED 0x01
694#define YH_ORIGIN_IMPORTED 0x02
697#define YH_ORIGIN_IMPORTED_WRAPPED 0x10
698
706const char *yh_strerror(yh_rc err);
707
724yh_rc yh_set_verbosity(yh_connector *connector, uint8_t verbosity);
725
737yh_rc yh_get_verbosity(uint8_t *verbosity);
738
748void yh_set_debug_output(yh_connector *connector, FILE *output);
749
755yh_rc yh_init(void);
756
762yh_rc yh_exit(void);
763
776yh_rc yh_init_connector(const char *url, yh_connector **connector);
777
793 const void *val);
794
805yh_rc yh_connect(yh_connector *connector, int timeout);
806
816
834 const uint8_t *data, size_t data_len,
835 yh_cmd *response_cmd, uint8_t *response,
836 size_t *response_len);
837
853 size_t data_len, yh_cmd *response_cmd,
854 uint8_t *response, size_t *response_len);
855
881 const uint8_t *password, size_t password_len,
882 bool recreate_session, yh_session **session);
883
909yh_rc yh_create_session(yh_connector *connector, uint16_t authkey_id,
910 const uint8_t *key_enc, size_t key_enc_len,
911 const uint8_t *key_mac, size_t key_mac_len,
912 bool recreate_session, yh_session **session);
913
938 uint8_t **context, uint8_t *card_cryptogram,
939 size_t card_cryptogram_len,
941
971 const uint8_t *key_senc, size_t key_senc_len,
972 const uint8_t *key_smac, size_t key_smac_len,
973 const uint8_t *key_srmac,
974 size_t key_srmac_len,
975 uint8_t *card_cryptogram,
976 size_t card_cryptogram_len);
977
990
1005
1006// Utility and convenience functions below
1007
1032 uint8_t *log_total, uint8_t *log_used,
1033 yh_algorithm *algorithms, size_t *n_algorithms);
1034
1070 yh_algorithm algorithm, const char *label,
1071 yh_object_descriptor *objects, size_t *n_objects);
1072
1089 yh_object_type type,
1090 yh_object_descriptor *object);
1091
1107 size_t *data_len, yh_algorithm *algorithm);
1108
1119
1139 const uint8_t *in, size_t in_len, uint8_t *out,
1140 size_t *out_len);
1141
1164 size_t in_len, uint8_t *out, size_t *out_len,
1165 size_t salt_len, yh_algorithm mgf1Algo);
1166
1186 const uint8_t *in, size_t in_len, uint8_t *out,
1187 size_t *out_len);
1188
1205 const uint8_t *in, size_t in_len, uint8_t *out,
1206 size_t *out_len);
1207
1224 size_t in_len, uint8_t *out, size_t *out_len);
1225
1239 size_t *out_len);
1240
1263 const char *label, uint16_t domains,
1266 const uint8_t *q);
1267
1292 const char *label, uint16_t domains,
1295
1314 const char *label, uint16_t domains,
1316 yh_algorithm algorithm, const uint8_t *k);
1317
1339 const char *label, uint16_t domains,
1341 yh_algorithm algorithm, const uint8_t *key,
1342 size_t key_len);
1343
1363 const char *label, uint16_t domains,
1366
1390 const char *label, uint16_t domains,
1393
1413 const char *label, uint16_t domains,
1416
1435 const uint8_t *signature, size_t signature_len,
1436 const uint8_t *data, size_t data_len, bool *verified);
1437
1458 const char *label, uint16_t domains,
1461
1479 const uint8_t *in, size_t in_len, uint8_t *out,
1480 size_t *out_len);
1481
1503 const uint8_t *in, size_t in_len, uint8_t *out,
1504 size_t *out_len, const uint8_t *label,
1505 size_t label_len, yh_algorithm mgf1Algo);
1506
1525 const uint8_t *in, size_t in_len, uint8_t *out,
1526 size_t *out_len);
1527
1541 yh_object_type type);
1542
1559 uint8_t *out, size_t *out_len);
1560
1577 const uint8_t *in, size_t in_len,
1579
1607 const char *label, uint16_t domains,
1611 const uint8_t *in, size_t in_len);
1612
1636 const char *label, uint16_t domains,
1640
1664 uint16_t *unlogged_auth, yh_log_entry *out,
1665 size_t *n_items);
1666
1683
1697 size_t *out_len);
1698
1720 const char *label, uint16_t domains,
1722 yh_algorithm algorithm, const uint8_t *in,
1723 size_t in_len);
1724
1744 uint16_t template_id, yh_algorithm sig_algo,
1745 const uint8_t *in, size_t in_len,
1746 uint8_t *out, size_t *out_len);
1747
1776 const yh_capabilities *delegated_capabilities, const uint8_t *key_enc,
1777 size_t key_enc_len, const uint8_t *key_mac, size_t key_mac_len);
1778
1804 const yh_capabilities *delegated_capabilities, const uint8_t *password,
1805 size_t password_len);
1806
1828 const uint8_t *key_enc,
1829 size_t key_enc_len,
1830 const uint8_t *key_mac,
1831 size_t key_mac_len);
1832
1853 const uint8_t *password,
1854 size_t password_len);
1855
1869 uint8_t *out, size_t *out_len);
1870
1892 const char *label, uint16_t domains,
1894 yh_algorithm algorithm, const uint8_t *in,
1895 size_t in_len);
1896
1912 const uint8_t *key, const uint8_t *private_id,
1913 uint8_t *out, size_t *out_len);
1914
1928 uint8_t *out, size_t *out_len);
1929
1949 const uint8_t *aead, size_t aead_len,
1950 const uint8_t *otp, uint16_t *useCtr,
1951 uint8_t *sessionCtr, uint8_t *tstph, uint16_t *tstpl);
1952
1974 const char *label, uint16_t domains,
1976 uint32_t nonce_id, const uint8_t *in,
1977 size_t in_len);
1978
2000 const char *label, uint16_t domains,
2002 yh_algorithm algorithm, uint32_t nonce_id);
2003
2019 uint16_t attest_id, uint8_t *out,
2020 size_t *out_len);
2021
2036 uint8_t *val);
2037
2051 size_t *out_len);
2052
2069 uint16_t *free_records, uint16_t *total_pages,
2070 uint16_t *free_pages, uint16_t *page_size);
2071
2088 size_t in_len, uint8_t *out, size_t *out_len);
2089
2106 const uint8_t *in, size_t in_len, uint8_t *out,
2107 size_t *out_len);
2108
2120
2132
2143
2152bool yh_connector_has_device(yh_connector *connector);
2153
2167
2177yh_rc yh_get_connector_address(yh_connector *connector, char **const address);
2178
2201yh_rc yh_string_to_capabilities(const char *capability,
2202 yh_capabilities *result);
2203
2219 const char *result[], size_t *n_result);
2220
2243 const char *capability);
2244
2260 yh_capabilities *result);
2261
2278 const yh_capabilities *filter,
2279 yh_capabilities *result);
2280
2293
2307
2318
2331
2344
2358yh_rc yh_algo_to_string(yh_algorithm algo, char const **result);
2359
2383yh_rc yh_string_to_algo(const char *string, yh_algorithm *algo);
2384
2406yh_rc yh_type_to_string(yh_object_type type, char const **result);
2407
2431yh_rc yh_string_to_type(const char *string, yh_object_type *type);
2432
2455yh_rc yh_string_to_option(const char *string, yh_option *option);
2456
2470bool yh_verify_logs(yh_log_entry *logs, size_t n_items,
2471 yh_log_entry *last_previous_log);
2472
2505yh_rc yh_string_to_domains(const char *domains, uint16_t *result);
2506
2527yh_rc yh_domains_to_string(uint16_t domains, char *string, size_t max_len);
2528#ifdef __cplusplus
2529}
2530#endif
2531
2532#endif
const mie::Vuint & p
Definition bn.cpp:27
CK_SESSION_HANDLE session
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181
string url
Definition main.cpp:166
unsigned short uint16_t
Definition stdint.h:125
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124
Capabilities representation.
Definition yubihsm.h:162
Definition yubihsm.h:516
uint16_t second_key
ID of second Object used.
Definition yubihsm.h:528
uint8_t result
Command result.
Definition yubihsm.h:530
uint32_t systick
Systick at time of execution.
Definition yubihsm.h:532
uint16_t session_key
ID of Authentication Key used.
Definition yubihsm.h:524
uint16_t target_key
ID of first Object used.
Definition yubihsm.h:526
uint16_t length
Length of in-data.
Definition yubihsm.h:522
uint8_t command
What command was executed.
Definition yubihsm.h:520
uint16_t number
Monotonically increasing index.
Definition yubihsm.h:518
uint16_t domains
Object domains.
Definition yubihsm.h:548
yh_algorithm algorithm
Object algorithm.
Definition yubihsm.h:552
uint16_t len
Object length.
Definition yubihsm.h:546
uint8_t sequence
Object sequence.
Definition yubihsm.h:554
uint16_t id
Object ID.
Definition yubihsm.h:544
yh_capabilities capabilities
Object capabilities.
Definition yubihsm.h:542
yh_capabilities delegated_capabilities
Object delegated capabilities.
Definition yubihsm.h:560
uint8_t origin
Object origin.
Definition yubihsm.h:556
yh_object_type type
Object type.
Definition yubihsm.h:550
uint8_t otp[32]
Definition yubico_otp.c:49
bool yh_verify_logs(yh_log_entry *logs, size_t n_items, yh_log_entry *last_previous_log)
Definition yubihsm.c:4480
yh_rc yh_domains_to_string(uint16_t domains, char *string, size_t max_len)
Definition yubihsm.c:4587
yh_option option
Definition yubihsm.h:685
bool yh_is_rsa(yh_algorithm algorithm)
Definition yubihsm.c:4245
yh_rc yh_util_get_option(yh_session *session, yh_option option, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3584
yh_rc yh_util_import_opaque(yh_session *session, uint16_t *object_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *in, size_t in_len)
Definition yubihsm.c:2666
bool yh_connector_has_device(yh_connector *connector)
Definition yubihsm.c:906
bool yh_is_ed(yh_algorithm algorithm)
Definition yubihsm.c:4280
yh_rc yh_get_verbosity(uint8_t *verbosity)
Definition yubihsm.c:3837
yh_rc yh_util_import_hmac_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *key, size_t key_len)
Definition yubihsm.c:1750
yh_rc yh_destroy_session(yh_session **session)
Definition yubihsm.c:890
yh_object_type type
Definition yubihsm.h:672
yh_rc yh_util_generate_hmac_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm)
Definition yubihsm.c:1992
yh_rc yh_util_generate_wrap_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const yh_capabilities *delegated_capabilities)
Definition yubihsm.c:2458
const char * yh_strerror(yh_rc err)
Definition error.c:65
yh_rc yh_set_verbosity(yh_connector *connector, uint8_t verbosity)
Definition yubihsm.c:3825
int bit
Definition yubihsm.h:566
#define YH_LOG_DIGEST_SIZE
Size that the log digest is truncated to.
Definition yubihsm.h:127
yh_rc yh_util_derive_ecdh(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2174
yh_rc yh_begin_create_session_ext(yh_connector *connector, uint16_t authkey_id, uint8_t **context, uint8_t *card_cryptogram, size_t card_cryptogram_len, yh_session **session)
Definition yubihsm.c:751
yh_rc yh_algo_to_string(yh_algorithm algo, char const **result)
Definition yubihsm.c:4384
yh_rc yh_get_connector_version(yh_connector *connector, uint8_t *major, uint8_t *minor, uint8_t *patch)
Definition yubihsm.c:911
yh_rc yh_util_generate_ec_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm)
Definition yubihsm.c:1913
yh_object_type
Definition yubihsm.h:359
@ YH_OTP_AEAD_KEY
OTP AEAD Key is a secret key used to decrypt Yubico OTP values.
Definition yubihsm.h:376
@ YH_WRAP_KEY
Definition yubihsm.h:369
@ YH_OPAQUE
Definition yubihsm.h:362
@ YH_HMAC_KEY
HMAC Key is a secret key used when computing and verifying HMAC signatures.
Definition yubihsm.h:371
@ YH_TEMPLATE
Definition yubihsm.h:374
@ YH_ASYMMETRIC_KEY
Asymmetric Key is the private key of an asymmetric key-pair.
Definition yubihsm.h:366
@ YH_AUTHENTICATION_KEY
Authentication Key is used to establish Sessions with a device.
Definition yubihsm.h:364
@ YH_PUBLIC_KEY
Definition yubihsm.h:379
bool yh_is_ec(yh_algorithm algorithm)
Definition yubihsm.c:4260
yh_rc yh_util_decrypt_otp(yh_session *session, uint16_t key_id, const uint8_t *aead, size_t aead_len, const uint8_t *otp, uint16_t *useCtr, uint8_t *sessionCtr, uint8_t *tstph, uint16_t *tstpl)
Definition yubihsm.c:3261
yh_rc yh_exit(void)
Definition yubihsm.c:3910
yh_rc yh_get_key_bitlength(yh_algorithm algorithm, size_t *result)
Definition yubihsm.c:4309
yh_rc yh_util_import_wrap_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const yh_capabilities *delegated_capabilities, const uint8_t *in, size_t in_len)
Definition yubihsm.c:2363
yh_rc yh_util_generate_ed_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm)
Definition yubihsm.c:1926
#define YH_OBJ_LABEL_LEN
Max length of object labels.
Definition yubihsm.h:123
yh_rc yh_util_sign_ssh_certificate(yh_session *session, uint16_t key_id, uint16_t template_id, yh_algorithm sig_algo, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2745
yh_rc yh_util_get_template(yh_session *session, uint16_t object_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2805
yh_algorithm
Definition yubihsm.h:390
@ YH_ALGO_EC_P521
ecp521
Definition yubihsm.h:418
@ YH_ALGO_MGF1_SHA512
mgf1-sha512
Definition yubihsm.h:460
@ YH_ALGO_RSA_PSS_SHA384
rsa-pss-sha384
Definition yubihsm.h:404
@ YH_ALGO_EC_ECDH
ecdh
Definition yubihsm.h:438
@ YH_ALGO_RSA_PKCS1_SHA256
rsa-pkcs1-sha256
Definition yubihsm.h:394
@ YH_ALGO_RSA_PKCS1_SHA1
rsa-pkcs1-sha1
Definition yubihsm.h:392
@ YH_ALGO_RSA_PSS_SHA512
rsa-pss-sha512
Definition yubihsm.h:406
@ YH_ALGO_EC_BP384
ecbp384
Definition yubihsm.h:424
@ YH_ALGO_RSA_PSS_SHA1
rsa-pss-sha1
Definition yubihsm.h:400
@ YH_ALGO_EC_ECDSA_SHA256
ecdsa-sha256
Definition yubihsm.h:476
@ YH_ALGO_EC_P384
ecp384
Definition yubihsm.h:416
@ YH_ALGO_EC_ECDSA_SHA512
ecdsa-sha512
Definition yubihsm.h:480
@ YH_ALGO_AES128_YUBICO_AUTHENTICATION
aes128-yubico-authentication
Definition yubihsm.h:466
@ YH_ALGO_RSA_OAEP_SHA256
rsa-oaep-sha256
Definition yubihsm.h:442
@ YH_ALGO_OPAQUE_X509_CERTIFICATE
opaque-x509-certificate
Definition yubihsm.h:452
@ YH_ALGO_AES192_YUBICO_OTP
aes192-yubico-otp
Definition yubihsm.h:468
@ YH_ALGO_AES128_YUBICO_OTP
aes128-yubico-otp
Definition yubihsm.h:464
@ YH_ALGO_EC_ECDSA_SHA384
ecdsa-sha384
Definition yubihsm.h:478
@ YH_ALGO_EC_ED25519
ed25519
Definition yubihsm.h:482
@ YH_ALGO_HMAC_SHA512
hmac-sha512
Definition yubihsm.h:434
@ YH_ALGO_HMAC_SHA384
hmac-sha384
Definition yubihsm.h:432
@ YH_ALGO_MGF1_SHA384
mgf1-sha384
Definition yubihsm.h:458
@ YH_ALGO_RSA_PKCS1_SHA512
rsa-pkcs1-sha512
Definition yubihsm.h:398
@ YH_ALGO_AES256_CCM_WRAP
aes256-ccm-wrap
Definition yubihsm.h:474
@ YH_ALGO_HMAC_SHA1
hmac-sha1
Definition yubihsm.h:428
@ YH_ALGO_RSA_OAEP_SHA512
rsa-oaep-sha512
Definition yubihsm.h:446
@ YH_ALGO_RSA_2048
rsa2048
Definition yubihsm.h:408
@ YH_ALGO_HMAC_SHA256
hmac-sha256
Definition yubihsm.h:430
@ YH_ALGO_RSA_OAEP_SHA384
rsa-oaep-sha384
Definition yubihsm.h:444
@ YH_ALGO_OPAQUE_DATA
opaque-data
Definition yubihsm.h:450
@ YH_ALGO_AES192_CCM_WRAP
aes192-ccm-wrap
Definition yubihsm.h:472
@ YH_ALGO_EC_BP512
ecbp512
Definition yubihsm.h:426
@ YH_ALGO_EC_BP256
ecbp256
Definition yubihsm.h:422
@ YH_ALGO_RSA_PSS_SHA256
rsa-pss-sha256
Definition yubihsm.h:402
@ YH_ALGO_AES256_YUBICO_OTP
aes256-yubico-otp
Definition yubihsm.h:470
@ YH_ALGO_EC_K256
eck256
Definition yubihsm.h:420
@ YH_ALGO_TEMPLATE_SSH
template-ssh
Definition yubihsm.h:462
@ YH_ALGO_MGF1_SHA1
mgf1-sha1
Definition yubihsm.h:454
@ YH_ALGO_AES128_CCM_WRAP
aes128-ccm-wrap
Definition yubihsm.h:448
@ YH_ALGO_MGF1_SHA256
mgf1-sha256
Definition yubihsm.h:456
@ YH_ALGO_EC_P256
ecp256
Definition yubihsm.h:414
@ YH_ALGO_RSA_4096
rsa4096
Definition yubihsm.h:412
@ YH_ALGO_EC_ECDSA_SHA1
ecdsa-sha1
Definition yubihsm.h:436
@ YH_ALGO_RSA_OAEP_SHA1
rsa-oaep-sha1
Definition yubihsm.h:440
@ YH_ALGO_EC_P224
ecp224
Definition yubihsm.h:484
@ YH_ALGO_RSA_PKCS1_SHA384
rsa-pkcs1-sha384
Definition yubihsm.h:396
@ YH_ALGO_RSA_3072
rsa3072
Definition yubihsm.h:410
yh_rc yh_util_randomize_otp_aead(yh_session *session, uint16_t key_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3223
yh_rc yh_send_secure_msg(yh_session *session, yh_cmd cmd, const uint8_t *data, size_t data_len, yh_cmd *response_cmd, uint8_t *response, size_t *response_len)
Definition yubihsm.c:416
yh_rc yh_create_session_derived(yh_connector *connector, uint16_t authkey_id, const uint8_t *password, size_t password_len, bool recreate_session, yh_session **session)
Definition yubihsm.c:593
yh_rc yh_util_sign_ecdsa(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:1411
yh_rc yh_init(void)
Definition yubihsm.c:3857
yh_rc yh_string_to_option(const char *string, yh_option *option)
Definition yubihsm.c:4463
yh_rc yh_util_unwrap_data(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3716
yh_rc yh_util_get_opaque(yh_session *session, uint16_t object_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2636
yh_rc yh_string_to_type(const char *string, yh_object_type *type)
Definition yubihsm.c:4442
yh_connector_option
Definition yubihsm.h:500
@ YH_CONNECTOR_PROXY_SERVER
Definition yubihsm.h:506
@ YH_CONNECTOR_HTTPS_CA
Definition yubihsm.h:503
yh_rc yh_util_sign_attestation_certificate(yh_session *session, uint16_t key_id, uint16_t attest_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3495
yh_rc yh_util_get_log_entries(yh_session *session, uint16_t *unlogged_boot, uint16_t *unlogged_auth, yh_log_entry *out, size_t *n_items)
Definition yubihsm.c:2531
yh_rc yh_util_reset_device(yh_session *session)
Definition yubihsm.c:3796
yh_rc yh_util_decrypt_pkcs1v1_5(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2059
yh_rc yh_util_close_session(yh_session *session)
Definition yubihsm.c:1257
#define ADD_COMMAND(c, v)
Macro to define command and response command.
Definition yubihsm.h:238
yh_algorithm algorithm
Definition yubihsm.h:619
yh_rc yh_util_sign_eddsa(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:1470
yh_rc yh_util_get_device_info(yh_connector *connector, uint8_t *major, uint8_t *minor, uint8_t *patch, uint32_t *serial, uint8_t *log_total, uint8_t *log_used, yh_algorithm *algorithms, size_t *n_algorithms)
Definition yubihsm.c:938
yh_rc yh_authenticate_session(yh_session *session)
Definition yubihsm.c:2927
yh_rc yh_send_plain_msg(yh_connector *connector, yh_cmd cmd, const uint8_t *data, size_t data_len, yh_cmd *response_cmd, uint8_t *response, size_t *response_len)
Definition yubihsm.c:126
yh_rc yh_util_import_ed_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *k)
Definition yubihsm.c:1727
yh_rc yh_util_get_object_info(yh_session *session, uint16_t id, yh_object_type type, yh_object_descriptor *object)
Definition yubihsm.c:1128
yh_rc yh_util_wrap_data(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3667
yh_rc yh_util_list_objects(yh_session *session, uint16_t id, yh_object_type type, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const char *label, yh_object_descriptor *objects, size_t *n_objects)
Definition yubihsm.c:1030
void yh_set_debug_output(yh_connector *connector, FILE *output)
Definition yubihsm.c:3848
yh_rc yh_util_import_authentication_key_derived(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, const yh_capabilities *delegated_capabilities, const uint8_t *password, size_t password_len)
Definition yubihsm.c:3064
yh_rc yh_util_create_otp_aead(yh_session *session, uint16_t key_id, const uint8_t *key, const uint8_t *private_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:3179
yh_rc yh_util_set_option(yh_session *session, yh_option option, size_t len, uint8_t *val)
Definition yubihsm.c:3537
yh_rc yh_util_change_authentication_key_derived(yh_session *session, uint16_t *key_id, const uint8_t *password, size_t password_len)
Definition yubihsm.c:3155
yh_rc yh_util_change_authentication_key(yh_session *session, uint16_t *key_id, const uint8_t *key_enc, size_t key_enc_len, const uint8_t *key_mac, size_t key_mac_len)
Definition yubihsm.c:3094
const char * name
Definition yubihsm.h:565
yh_rc yh_filter_capabilities(const yh_capabilities *capabilities, const yh_capabilities *filter, yh_capabilities *result)
Definition yubihsm.c:4231
yh_rc yh_util_sign_hmac(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:1520
yh_rc yh_util_sign_pss(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len, size_t salt_len, yh_algorithm mgf1Algo)
Definition yubihsm.c:1346
yh_rc yh_string_to_domains(const char *domains, uint16_t *result)
Definition yubihsm.c:4535
yh_rc yh_set_connector_option(yh_connector *connector, yh_connector_option opt, const void *val)
Definition yubihsm.c:4063
yh_rc yh_init_connector(const char *url, yh_connector **connector)
Definition yubihsm.c:4024
yh_rc yh_util_set_log_index(yh_session *session, uint16_t index)
Definition yubihsm.c:2606
yh_rc yh_util_generate_otp_aead_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, uint32_t nonce_id)
Definition yubihsm.c:3422
yh_rc yh_util_sign_pkcs1v1_5(yh_session *session, uint16_t key_id, bool hashed, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:1287
yh_rc yh_connect(yh_connector *connector, int timeout)
Definition yubihsm.c:4079
yh_rc yh_util_export_wrapped(yh_session *session, uint16_t wrapping_key_id, yh_object_type target_type, uint16_t target_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2265
yh_cmd
Definition yubihsm.h:243
@ YHC_ERROR
Definition yubihsm.h:348
yh_rc yh_util_get_public_key(yh_session *session, uint16_t id, uint8_t *data, size_t *data_len, yh_algorithm *algorithm)
Definition yubihsm.c:1216
yh_rc yh_util_decrypt_oaep(yh_session *session, uint16_t key_id, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len, const uint8_t *label, size_t label_len, yh_algorithm mgf1Algo)
Definition yubihsm.c:2107
yh_rc yh_string_to_capabilities(const char *capability, yh_capabilities *result)
Definition yubihsm.c:4115
yh_rc yh_string_to_algo(const char *string, yh_algorithm *algo)
Definition yubihsm.c:4403
yh_rc yh_util_import_rsa_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *p, const uint8_t *q)
Definition yubihsm.c:1655
yh_rc yh_disconnect(yh_connector *connector)
Definition yubihsm.c:4097
yh_rc yh_util_generate_rsa_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm)
Definition yubihsm.c:1900
yh_rc yh_util_verify_hmac(yh_session *session, uint16_t key_id, const uint8_t *signature, size_t signature_len, const uint8_t *data, size_t data_len, bool *verified)
Definition yubihsm.c:1939
bool yh_check_capability(const yh_capabilities *capabilities, const char *capability)
Definition yubihsm.c:4198
yh_rc yh_create_session(yh_connector *connector, uint16_t authkey_id, const uint8_t *key_enc, size_t key_enc_len, const uint8_t *key_mac, size_t key_mac_len, bool recreate_session, yh_session **session)
Definition yubihsm.c:616
yh_rc yh_util_import_authentication_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, const yh_capabilities *delegated_capabilities, const uint8_t *key_enc, size_t key_enc_len, const uint8_t *key_mac, size_t key_mac_len)
Definition yubihsm.c:2985
yh_rc yh_capabilities_to_strings(const yh_capabilities *num, const char *result[], size_t *n_result)
Definition yubihsm.c:4168
bool yh_is_hmac(yh_algorithm algorithm)
Definition yubihsm.c:4293
yh_rc yh_get_connector_address(yh_connector *connector, char **const address)
Definition yubihsm.c:926
yh_option
Definition yubihsm.h:490
@ YH_OPTION_FORCE_AUDIT
Enable/Disable Forced Audit mode.
Definition yubihsm.h:492
@ YH_OPTION_COMMAND_AUDIT
Enable/Disable logging of specific commands.
Definition yubihsm.h:494
yh_rc yh_util_blink_device(yh_session *session, uint8_t seconds)
Definition yubihsm.c:3766
#define YH_CAPABILITIES_LEN
Length of capabilities array.
Definition yubihsm.h:119
yh_rc yh_util_import_ec_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *s)
Definition yubihsm.c:1689
yh_rc yh_util_import_otp_aead_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, uint32_t nonce_id, const uint8_t *in, size_t in_len)
Definition yubihsm.c:3337
yh_rc yh_util_import_template(yh_session *session, uint16_t *object_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *in, size_t in_len)
Definition yubihsm.c:2835
yh_rc
Definition yubihsm.h:170
@ YHR_INIT_ERROR
Returned value when failing to initialize libyubihsm.
Definition yubihsm.h:176
@ YHR_DEVICE_INSUFFICIENT_PERMISSIONS
Return value when the permissions to perform the operation are wrong.
Definition yubihsm.h:214
@ YHR_DEVICE_INVALID_SESSION
Returned value when the device session is invalid.
Definition yubihsm.h:201
@ YHR_GENERIC_ERROR
Return value when encountering an unknown error.
Definition yubihsm.h:228
@ YHR_SUCCESS
Returned value when function was successful.
Definition yubihsm.h:172
@ YHR_DEVICE_COMMAND_UNEXECUTED
Return value when the command execution has not terminated.
Definition yubihsm.h:226
@ YHR_INVALID_PARAMETERS
Returned value when an argument to a function is invalid.
Definition yubihsm.h:182
@ YHR_MEMORY_ERROR
Returned value when unable to allocate memory.
Definition yubihsm.h:174
@ YHR_DEVICE_INVALID_COMMAND
Returned value when the device receives and invalid command.
Definition yubihsm.h:197
@ YHR_DEVICE_SESSIONS_FULL
Return value when no more sessions can be opened on the device.
Definition yubihsm.h:205
@ YHR_DEVICE_SESSION_FAILED
Return value when failing to create a device session.
Definition yubihsm.h:207
@ YHR_DEVICE_OBJECT_NOT_FOUND
Return value when the object not found on the device.
Definition yubihsm.h:218
@ YHR_DEVICE_AUTHENTICATION_FAILED
Return value when the device fails to encrypt or verify the message.
Definition yubihsm.h:203
@ YHR_DEVICE_LOG_FULL
Return value when the log buffer is full and forced audit is set.
Definition yubihsm.h:216
@ YHR_DEVICE_INVALID_OTP
Return value when an invalid OTP is submitted.
Definition yubihsm.h:222
@ YHR_DEVICE_DEMO_MODE
Return value when the device is in demo mode and has to be power cycled.
Definition yubihsm.h:224
@ YHR_DEVICE_INVALID_DATA
Returned value when the device receives a malformed command invalid data.
Definition yubihsm.h:199
@ YHR_CONNECTOR_NOT_FOUND
Returned value when failing to find a suitable connector.
Definition yubihsm.h:180
@ YHR_DEVICE_STORAGE_FAILED
Return value when encountering a storage failure on the device.
Definition yubihsm.h:209
@ YHR_DEVICE_OBJECT_EXISTS
Return value when trying to add an object with an ID that already exists.
Definition yubihsm.h:230
@ YHR_BUFFER_TOO_SMALL
Returned value when there is not enough space to store data.
Definition yubihsm.h:187
@ YHR_CONNECTOR_ERROR
Return value when connector operation failed.
Definition yubihsm.h:232
@ YHR_MAC_MISMATCH
Returned value when failing to verify MAC.
Definition yubihsm.h:193
@ YHR_WRONG_LENGTH
Definition yubihsm.h:185
@ YHR_DEVICE_WRONG_LENGTH
Definition yubihsm.h:212
@ YHR_CONNECTION_ERROR
Returned value when a connection error was encountered.
Definition yubihsm.h:178
@ YHR_DEVICE_SSH_CA_CONSTRAINT_VIOLATION
Return value when encountering SSH CA constraint violation.
Definition yubihsm.h:234
@ YHR_DEVICE_OK
Returned value when the device returned no error.
Definition yubihsm.h:195
@ YHR_DEVICE_INVALID_ID
Return value when an invalid Object ID is used.
Definition yubihsm.h:220
@ YHR_SESSION_AUTHENTICATION_FAILED
Returned value when failing to authenticate the session.
Definition yubihsm.h:191
@ YHR_CRYPTOGRAM_MISMATCH
Returned value when failing to verify cryptogram.
Definition yubihsm.h:189
yh_rc yh_util_import_wrapped(yh_session *session, uint16_t wrapping_key_id, const uint8_t *in, size_t in_len, yh_object_type *target_type, uint16_t *target_id)
Definition yubihsm.c:2309
yh_rc yh_util_delete_object(yh_session *session, uint16_t id, yh_object_type type)
Definition yubihsm.c:2222
yh_rc yh_util_get_storage_info(yh_session *session, uint16_t *total_records, uint16_t *free_records, uint16_t *total_pages, uint16_t *free_pages, uint16_t *page_size)
Definition yubihsm.c:3610
yh_rc yh_get_session_id(yh_session *session, uint8_t *sid)
Definition yubihsm.c:2915
yh_rc yh_util_get_pseudo_random(yh_session *session, size_t len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:1560
yh_rc yh_finish_create_session_ext(yh_connector *connector, yh_session *session, const uint8_t *key_senc, size_t key_senc_len, const uint8_t *key_smac, size_t key_smac_len, const uint8_t *key_srmac, size_t key_srmac_len, uint8_t *card_cryptogram, size_t card_cryptogram_len)
Definition yubihsm.c:847
yh_rc yh_merge_capabilities(const yh_capabilities *a, const yh_capabilities *b, yh_capabilities *result)
Definition yubihsm.c:4219
yh_rc yh_type_to_string(yh_object_type type, char const **result)
Definition yubihsm.c:4424
uint8_t patch
yh_capabilities capabilities
uint32_t serial
yh_object_type target_type
char * label
session operation op find n_objects
char * s
uint16_t domains
size_t out_len
uint8_t major
size_t len
session operation op sign key_len
uint16_t target_id
uint16_t key_id
uint8_t minor
size_t label_len
size_t in_len
yh_capabilities delegated_capabilities