X-Git-Url: https://git.librecmc.org/?p=oweals%2Fucert.git;a=blobdiff_plain;f=ucert.c;h=ac044201875da5046c0b7b29941a00e8641ffe69;hp=54ec2233cbe57713439dccbcee26f7d0bdb24bdf;hb=b37db5b51290fb82bb66a071c1a16d57ca58e920;hpb=d96a92aa533a07ea10e57553aa167b1b0151bcac diff --git a/ucert.c b/ucert.c index 54ec223..ac04420 100644 --- a/ucert.c +++ b/ucert.c @@ -43,6 +43,37 @@ static enum { static bool quiet; +enum cert_attr { + CERT_ATTR_SIGNATURE, + CERT_ATTR_PAYLOAD, + CERT_ATTR_MAX +}; + +static const struct blob_attr_info cert_policy[CERT_ATTR_MAX] = { + [CERT_ATTR_SIGNATURE] = { .type = BLOB_ATTR_BINARY }, + [CERT_ATTR_PAYLOAD] = { .type = BLOB_ATTR_NESTED }, +}; + +enum cert_payload_attr { + CERT_PL_ATTR_CERTTYPE, + CERT_PL_ATTR_CERTID, + CERT_PL_ATTR_PUBKEY, + CERT_PL_ATTR_KEY_FINGERPRINT, + CERT_PL_ATTR_MAX +}; + +enum certtype_id { + CERTTYPE_AUTH, + CERTTYPE_REVOKE +}; + +static const struct blobmsg_policy cert_payload_policy[CERT_PL_ATTR_MAX] = { + [CERT_PL_ATTR_CERTTYPE] = { .type = BLOBMSG_TYPE_INT8 }, + [CERT_PL_ATTR_CERTID] = { .type = BLOBMSG_TYPE_INT64 }, + [CERT_PL_ATTR_PUBKEY] = { .type = BLOBMSG_TYPE_STRING }, + [CERT_PL_ATTR_KEY_FINGERPRINT] = { .type = BLOBMSG_TYPE_STRING }, +}; + static int cert_append(const char *certfile, const char *pubkeyfile, const char *sigfile) { fprintf(stderr, "not implemented\n"); return 1;