mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-18 18:56:25 +00:00
fixed various bugs with rhizome manifest extraction.
This commit is contained in:
parent
1a3d13d59e
commit
74e0d69cb9
@ -1154,10 +1154,12 @@ int app_rhizome_extract_manifest(int argc, const char *const *argv, struct comma
|
||||
case 0: ret = 1; break;
|
||||
case 1: ret = 0;
|
||||
if (manifestpath[0]) {
|
||||
#warning why do we ask for the manifest to be signed here, when we are just extracting it? Anyway, it wont work while the author field is null.
|
||||
if (rhizome_manifest_finalise(m, 1,NULL) == -1)
|
||||
ret = WHY("Could not overwrite manifest file.");
|
||||
else if (rhizome_write_manifest_file(m, manifestpath) == -1)
|
||||
/* If the manifest has been read in from database, the blob is there,
|
||||
and we can lie and say we are finalised and just want to write it
|
||||
out. XXX really should have a dirty/clean flag, so that write
|
||||
works is clean but not finalised. */
|
||||
m->finalised=1;
|
||||
if (rhizome_write_manifest_file(m, manifestpath) == -1)
|
||||
ret = WHY("Could not overwrite manifest file.");
|
||||
}
|
||||
break;
|
||||
|
@ -107,6 +107,10 @@ int extractSid(unsigned char *packet,int *ofs,char *sid)
|
||||
|
||||
int validateSid(const char *sid)
|
||||
{
|
||||
if (!sid) {
|
||||
WHY("SID == NULL");
|
||||
return 0;
|
||||
}
|
||||
if (!strcasecmp(sid,"broadcast")) return 1;
|
||||
size_t n = strlen(sid);
|
||||
if (n != SID_STRLEN)
|
||||
|
@ -140,6 +140,7 @@ int rhizome_bk_xor(const char *author,
|
||||
*/
|
||||
int rhizome_extract_privatekey(rhizome_manifest *m,const char *authorHex)
|
||||
{
|
||||
if (!authorHex) return WHY("No author SID supplied");
|
||||
char *bk = rhizome_manifest_get(m, "BK", NULL, 0);
|
||||
if (!bk) return WHY("Cannot obtain private key as manifest lacks BK field");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user