SimpleOTA client v1.2.0
Shared core of the SimpleOTA Arduino and ESP-IDF clients
Loading...
Searching...
No Matches
sota_manifest.h
Go to the documentation of this file.
1
29#ifndef SOTA_MANIFEST_H
30#define SOTA_MANIFEST_H
31
32#include <stdbool.h>
33#include <stddef.h>
34#include <stdint.h>
35
36#include "sota_signing.h"
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
45#define SOTA_MANIFEST_V1_MAGIC "SimpleOTA-Manifest-v1"
46
53
67static inline sota_manifest_gate_t sota_manifest_gate(bool required, bool has_project,
68 uint8_t num_keys,
69 bool offer_has_manifest)
70{
71 bool can_check = has_project && num_keys > 0 && offer_has_manifest;
72 if (can_check) return SOTA_MANIFEST_VERIFY;
74}
75
78bool sota_manifest_field_ok(const char *s);
79
87bool sota_manifest_feed(sota_sig_verifier_t *v, const char *project_id, const char *key_id,
88 uint32_t build, const char *checksum);
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif /* SOTA_MANIFEST_H */
sota_manifest_gate_t
What to do about an offer's manifest (see sota_manifest_gate()).
Definition sota_manifest.h:48
@ SOTA_MANIFEST_FAIL_CLOSED
Required, and absent or uncheckable: refuse.
Definition sota_manifest.h:51
@ SOTA_MANIFEST_VERIFY
Check it before the download.
Definition sota_manifest.h:50
@ SOTA_MANIFEST_SKIP
Not checked: the image signature decides.
Definition sota_manifest.h:49
bool sota_manifest_feed(sota_sig_verifier_t *v, const char *project_id, const char *key_id, uint32_t build, const char *checksum)
Feed a version 1 manifest's bytes to a verifier that sota_verifier_begin() has started with the manif...
bool sota_manifest_field_ok(const char *s)
True for a project id or key id that can stand on a manifest line: no control characters,...
static sota_manifest_gate_t sota_manifest_gate(bool required, bool has_project, uint8_t num_keys, bool offer_has_manifest)
Decide from the device's own settings, never from what the offer claims about itself.
Definition sota_manifest.h:67
Ed25519 firmware-signature helpers for the SimpleOTA clients.
A streaming signature check against each candidate key at once.
Definition sota_signing.h:112