feat(sec): 二期签名鉴权 2A 最小闭环 (agent-185) — meow_verify(Ed25519验签CLI,公钥固化,TweetNaCl+SHA256单文件) + meow_sign(宿主keygen/sign,尾部180B footer签名块,私钥仅.keys/不入库) + nyai/meow_pkg_install 验签分级(有签必验/os.meow.*无签拒装/第三方直装告警/三重绑定/原签存.mpk.src导出保留) + svc_power IPC鉴权(SO_PEERCRED→/proc/pid/exe→包名/系统身份allowlist,系统动作仅os.meow.*或系统身份) + cmd_upgrade同步签名分级防绕过
meow_verify 37e50606; nyai f2938d28; svc_power e0494eb7; launcher 24c9ee5d(含热重载) 宿主验证12项全过(正例/篡负载/篡包名/无签系统包拒/第三方直装/降级拒/导出round-trip byte-identical/verify缺失宁缺勿装/footer容忍/E2E PERM/鉴权分类) 出入: TweetNaCl替orlp/ed25519(任务允许同等实现); 读级暂仍uid==0(用户随后定案放宽到任意调用者,待改); 系统身份allowlist为启发式
This commit is contained in:
1 parent
f50abae02a
commit
3f57d7fd4f
22 files changed
+1978
-15
No files matched your search
@@ -0,0 +1,21 @@
|
||||
/* sha256.h — minimal public-domain SHA-256 context/API for MeowOS .mpk payload hashing.
|
||||
* Used by meow_verify (device) and meow_sign (host) to compute .mpk 的 payload_sha256
|
||||
* (tar.gz 前缀哈希)。流式 API,避免整包载入内存。 */
|
||||
#ifndef MEOW_SHA256_H
|
||||
#define MEOW_SHA256_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
uint32_t state[8];
|
||||
uint64_t count; /* 已输入总字节数 */
|
||||
uint8_t buf[64]; /* 未满一块的缓冲 */
|
||||
size_t buflen;
|
||||
} meow_sha256_ctx;
|
||||
|
||||
void meow_sha256_init(meow_sha256_ctx *c);
|
||||
void meow_sha256_update(meow_sha256_ctx *c, const uint8_t *data, size_t len);
|
||||
void meow_sha256_final(meow_sha256_ctx *c, uint8_t out[32]);
|
||||
|
||||
#endif /* MEOW_SHA256_H */
|
||||
Reference in new issue
Block a user