#ifndef TLSPOOL_COMMANDS_H
#define TLSPOOL_COMMANDS_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
#include <stdint.h>
*/
#pragma pack(push,2)
+
+struct pioc_pinentry {
+ uint32_t flags; // PIOF_PINENTRY_xxx below
+ uint32_t attempt; // Attempt counter -- display!
+ uint32_t timeout_us; // Timeout in microseconds
+ char pin [128]; // Empty string means no PIN
+ char prompt [128]; // Prompt from TLS Pool
+ char token_manuf[32 + 1 + 3]; // PKCS #11 token manufacturer
+ char token_model[16 + 1 + 3]; // PKCS #11 token model
+ char token_serial[16 + 1 + 3]; // PKCS #11 token serial number
+ char token_label[32 + 1 + 3]; // PKCS #11 token label
+};
+
+struct pioc_lidentry {
+ uint32_t flags; // PIOF_LIDENTRY_xxx below
+ uint16_t maxlevels; // Max # iterations for concrete ID
+ uint32_t timeout; // Regtimeout[s] or resptimeout
+ char localid [128]; // Local ID or empty string
+ char remoteid [128];// Remote ID or empty string
+};
+
struct tlspool_command {
uint16_t pio_reqid; // Request->Response request identifier
uint16_t pio_cbid; // Response->Request callback identifier
uint8_t service [TLSPOOL_SERVICELEN]; // Names from IANA
uint32_t timeout; // in ms, 0=default, ~0=infinite
} pioc_starttls;
- struct pioc_pinentry {
- uint32_t flags; // PIOF_PINENTRY_xxx below
- uint32_t attempt; // Attempt counter -- display!
- uint32_t timeout_us; // Timeout in microseconds
- char pin [128]; // Empty string means no PIN
- char prompt [128]; // Prompt from TLS Pool
- char token_manuf[32 + 1 + 3]; // PKCS #11 token manufacturer
- char token_model[16 + 1 + 3]; // PKCS #11 token model
- char token_serial[16 + 1 + 3]; // PKCS #11 token serial number
- char token_label[32 + 1 + 3]; // PKCS #11 token label
- } pioc_pinentry;
- struct pioc_lidentry {
- uint32_t flags; // PIOF_LIDENTRY_xxx below
- uint16_t maxlevels; // Max # iterations for concrete ID
- uint32_t timeout; // Regtimeout[s] or resptimeout
- char localid [128]; // Local ID or empty string
- char remoteid [128]; // Remote ID or empty string
- } pioc_lidentry;
+ struct pioc_pinentry pioc_pinentry;
+ struct pioc_lidentry pioc_lidentry;
struct pioc_control {
uint32_t flags; // PIOF_CONTROL_xxx, none yet
uint8_t ctlkey [TLSPOOL_CTLKEYLEN]; // Control key
*/
#define PIOF_LIDENTRY_ONTHEFLY 0x00200000
+#ifdef __cplusplus
+}
+#endif
#endif //TLSPOOL_COMMANDS_H
#ifndef TLSPOOL_STARTTLS_H
#define TLSPOOL_STARTTLS_H
+#ifdef __cplusplus
+extern "C"
+{
+#endif
#include <tlspool/commands.h>
#ifdef WINDOWS_PORT
#include <windows.h>
+#else
+#include <unistd.h>
#endif /* WINDOWS_PORT */
*
* This function returns -1 on error, or 0 on success.
*/
-int tlspool_pin_service (char *path, uint32_t regflags, int responsetimeout_usec, void (*cb) (struct pioc_pinentry *entry, void *data), void *data);
+int tlspool_pin_service (char *path, uint32_t regflags, int responsetimeout_usec, void (*cb) (pinentry_t *entry, void *data), void *data);
/* Generate a pseudo-random sequence based on session cryptographic keys.
*
uint16_t prng_len, uint8_t *prng_buf,
uint8_t *ctlkey);
+#ifdef __cplusplus
+}
+#endif
+
#endif // TLSPOOL_STARTTLS_H