Files
MeowOS 3f57d7fd4f 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为启发式
2026-08-31 04:33:46 +08:00

24 lines
1.2 KiB
C

/* tweetnacl.h — TweetNaCl 用于 MeowOS .mpk 签名/验签的最小声明头(Ed25519 + SHA-512 子集)。
* 实现:https://tweetnacl.cr.yp.to/20140427/tweetnacl.c (公有领域)。
* 仅暴露 meow_verify / meow_sign 需要的一小片 API;其余(salsa20/box/secretbox…)
* 在 tweetnacl.c 内保留但未声明,未引用即不进入最终链接。 */
#ifndef TWEETNACL_H
#define TWEETNACL_H
#define crypto_sign_BYTES 64
#define crypto_sign_PUBLICKEYBYTES 32
#define crypto_sign_SECRETKEYBYTES 64
#define crypto_hash_BYTES 64
int crypto_verify_16(const unsigned char *x, const unsigned char *y);
int crypto_verify_32(const unsigned char *x, const unsigned char *y);
int crypto_hash(unsigned char *out, const unsigned char *m, unsigned long long n);
int crypto_sign_keypair(unsigned char *public_key, unsigned char *secret_key);
int crypto_sign(unsigned char *sm, unsigned long long *smlen,
const unsigned char *m, unsigned long long n, const unsigned char *sk);
int crypto_sign_open(unsigned char *m, unsigned long long *mlen,
const unsigned char *sm, unsigned long long n, const unsigned char *pk);
#endif /* TWEETNACL_H */