27#include "monocypher-ed25519.h"
60 bool offer_signed,
bool offer_has_signature);
95#define SOTA_VERIFIER_MAX_KEYS 2
113 const uint8_t keys[][32], uint8_t num_keys);
bool sota_parse_ed25519_public_key_pem(const char *pem, uint8_t out[32])
Parse a PEM "BEGIN PUBLIC KEY" (SubjectPublicKeyInfo) Ed25519 key, the exact format the SimpleOTA das...
bool sota_verifier_begin(sota_sig_verifier_t *v, const uint8_t sig[64], const uint8_t keys[][32], uint8_t num_keys)
Start checking sig against each of the candidate keys.
sota_signed_gate_t sota_signed_gate(bool device_reports_signed, uint8_t num_keys, bool offer_signed, bool offer_has_signature)
Decide how to handle a (possibly signed) offer, from device policy and the offer's own claims.
bool sota_verifier_final(sota_sig_verifier_t *v)
#define SOTA_VERIFIER_MAX_KEYS
Streaming Ed25519 verifier over one firmware image, for up to two candidate public keys (key rotation...
Definition sota_signing.h:95
bool sota_decode_signature_b64(const char *b64, uint8_t out[64])
Decode a base64 Ed25519 signature (as sent in the OTA check response) into its raw 64 bytes.
sota_signed_gate_t
Outcome of the signed-firmware policy decision (see sota_signed_gate).
Definition sota_signing.h:34
@ SOTA_GATE_VERIFY
Verify the signature during download.
Definition sota_signing.h:36
@ SOTA_GATE_SKIP
Not a signed update; apply normally.
Definition sota_signing.h:35
@ SOTA_GATE_WARN_UNVERIFIED
Signed offer but no key to check it; apply + warn.
Definition sota_signing.h:38
@ SOTA_GATE_FAIL_CLOSED
A signature is required but absent/unusable; reject now.
Definition sota_signing.h:37
void sota_verifier_update(sota_sig_verifier_t *v, const uint8_t *data, size_t len)
Feed the next chunk of the image, in download order.
A streaming signature check against each candidate key at once.
Definition sota_signing.h:98
uint8_t num_keys
Checks in use.
Definition sota_signing.h:100