mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-31 08:25:22 +00:00
Allow checking for a self signed manifest author with no loaded keyring
This commit is contained in:
parent
e158a38137
commit
dfe108d287
@ -1483,7 +1483,6 @@ struct rhizome_bundle_result rhizome_fill_manifest(rhizome_manifest *m, const ch
|
|||||||
int rhizome_lookup_author(rhizome_manifest *m)
|
int rhizome_lookup_author(rhizome_manifest *m)
|
||||||
{
|
{
|
||||||
IN();
|
IN();
|
||||||
assert(keyring != NULL);
|
|
||||||
switch (m->authorship) {
|
switch (m->authorship) {
|
||||||
case AUTHOR_LOCAL:
|
case AUTHOR_LOCAL:
|
||||||
case AUTHOR_AUTHENTIC:
|
case AUTHOR_AUTHENTIC:
|
||||||
@ -1491,7 +1490,7 @@ int rhizome_lookup_author(rhizome_manifest *m)
|
|||||||
RETURN(1);
|
RETURN(1);
|
||||||
case AUTHOR_NOT_CHECKED:
|
case AUTHOR_NOT_CHECKED:
|
||||||
DEBUGF(rhizome, "manifest %p lookup author=%s", m, alloca_tohex_sid_t(m->author));
|
DEBUGF(rhizome, "manifest %p lookup author=%s", m, alloca_tohex_sid_t(m->author));
|
||||||
if (keyring_find_identity_sid(keyring, &m->author)) {
|
if (keyring && keyring_find_identity_sid(keyring, &m->author)) {
|
||||||
DEBUGF(rhizome, "found author");
|
DEBUGF(rhizome, "found author");
|
||||||
m->authorship = AUTHOR_LOCAL;
|
m->authorship = AUTHOR_LOCAL;
|
||||||
RETURN(1);
|
RETURN(1);
|
||||||
@ -1500,7 +1499,7 @@ int rhizome_lookup_author(rhizome_manifest *m)
|
|||||||
case ANONYMOUS:
|
case ANONYMOUS:
|
||||||
if (m->has_sender) {
|
if (m->has_sender) {
|
||||||
DEBUGF(rhizome, "manifest %p lookup sender=%s", m, alloca_tohex_sid_t(m->sender));
|
DEBUGF(rhizome, "manifest %p lookup sender=%s", m, alloca_tohex_sid_t(m->sender));
|
||||||
if (keyring_find_identity_sid(keyring, &m->sender)) {
|
if (keyring && keyring_find_identity_sid(keyring, &m->sender)) {
|
||||||
DEBUGF(rhizome, "found sender");
|
DEBUGF(rhizome, "found sender");
|
||||||
rhizome_manifest_set_author(m, &m->sender);
|
rhizome_manifest_set_author(m, &m->sender);
|
||||||
m->authorship = AUTHOR_LOCAL;
|
m->authorship = AUTHOR_LOCAL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user