mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-29 15:43:56 +00:00
Set service of private bundles
This commit is contained in:
parent
77198dd163
commit
650db68a69
@ -328,6 +328,7 @@ int rhizome_manifest_remove_field(rhizome_manifest *, const char *field_label, s
|
||||
#define RHIZOME_SERVICE_MESHMS "MeshMS1"
|
||||
#define RHIZOME_SERVICE_MESHMS2 "MeshMS2"
|
||||
#define RHIZOME_SERVICE_MESHMB "MeshMB1"
|
||||
#define RHIZOME_SERVICE_PRIVATE "private"
|
||||
|
||||
extern int64_t rhizome_space;
|
||||
|
||||
|
@ -49,8 +49,8 @@ struct rhizome_bundle_result rhizome_private_bundle(rhizome_manifest *m, const s
|
||||
rhizome_manifest_set_id(m, &keypair->public_key); // zerofills m->keypair.binary
|
||||
m->keypair = *keypair;
|
||||
m->haveSecret = NEW_BUNDLE_ID;
|
||||
rhizome_manifest_set_service(m, RHIZOME_SERVICE_FILE);
|
||||
rhizome_manifest_set_name(m, "");
|
||||
rhizome_manifest_set_service(m, RHIZOME_SERVICE_PRIVATE);
|
||||
rhizome_manifest_del_name(m);
|
||||
// always consider the content encrypted, we don't need to rely on the manifest itself.
|
||||
rhizome_manifest_set_crypt(m, PAYLOAD_ENCRYPTED);
|
||||
// setting the author would imply needing a BK, which we don't need since the private key is seeded above.
|
||||
@ -58,10 +58,9 @@ struct rhizome_bundle_result rhizome_private_bundle(rhizome_manifest *m, const s
|
||||
case RHIZOME_BUNDLE_STATUS_SAME:
|
||||
m->haveSecret = EXISTING_BUNDLE_ID;
|
||||
m->keypair = *keypair;
|
||||
// always consider the content encrypted, we don't need to rely on the manifest itself.
|
||||
rhizome_manifest_set_crypt(m, PAYLOAD_ENCRYPTED);
|
||||
if (strcmp(m->service, RHIZOME_SERVICE_FILE) != 0)
|
||||
return rhizome_bundle_result(RHIZOME_BUNDLE_STATUS_ERROR);
|
||||
rhizome_manifest_set_service(m, RHIZOME_SERVICE_PRIVATE);
|
||||
rhizome_manifest_del_name(m);
|
||||
// fallthrough
|
||||
default:
|
||||
return rhizome_bundle_result(ret);
|
||||
|
Loading…
x
Reference in New Issue
Block a user