CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
IChallengeResponder.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5
6namespace cdc::core {
7
18public:
20 static constexpr size_t MAX_RESPONSE_LEN = 32;
21
22 virtual ~IChallengeResponder() = default;
23
39 virtual int challengeResponse(const char* entryName, const uint8_t* challenge,
40 size_t clen, uint8_t* out) = 0;
41
58 virtual int challengeResponseUsbSlot(const uint8_t* challenge, size_t clen,
59 uint8_t* out, bool* touchRequiredOut) = 0;
60};
61
62} // namespace cdc::core
Challenge-response provider interface.
virtual int challengeResponseUsbSlot(const uint8_t *challenge, size_t clen, uint8_t *out, bool *touchRequiredOut)=0
Computes the raw HMAC response for the designated USB-CR slot entry.
static constexpr size_t MAX_RESPONSE_LEN
Largest possible raw HMAC response (SHA256). Callers size out to this.
virtual ~IChallengeResponder()=default
virtual int challengeResponse(const char *entryName, const uint8_t *challenge, size_t clen, uint8_t *out)=0
Computes the raw HMAC challenge-response for a named CR entry.