commit f52b9961478e9dc05aa7d94388d02eefcd0e8bca
parent 0fc8e29aafecb14d8bfee0b46ac51cc796315ffe
Author: lash <dev@holbrook.no>
Date: Sun, 2 Mar 2025 18:23:22 +0000
Add request signature to response signature material
Diffstat:
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/lq/cert.c b/src/lq/cert.c
@@ -54,7 +54,10 @@ void lq_certificate_set_domain(LQCert *cert, const char *domain) {
lq_cpy(cert->domain, domain, LQ_CERT_DOMAIN_LEN);
}
-static int state_digest(LQCert *cert, char *out) {
+// prefix with domain
+// also, IF request signature exists, append signature to domain
+static int state_digest(LQCert *cert, char *out, int resolve_parent) {
+ int r;
int c;
char data[1024];
char *p;
@@ -64,6 +67,15 @@ static int state_digest(LQCert *cert, char *out) {
lq_cpy(p, cert->domain, c);
p += c;
+ if (cert->parent != NULL && resolve_parent) {
+ r = state_digest(cert->parent, p, 0);
+ if (r != ERR_OK) {
+ return r;
+ }
+ c += LQ_DIGEST_LEN;
+ p += LQ_DIGEST_LEN;
+ }
+
if (cert->request_sig != NULL) {
lq_cpy(p, cert->request_sig->losig, cert->request_sig->lolen);
c += cert->request_sig->lolen;