servalproject / serval-dna

The Serval Project's core daemon that implements Distributed Numbering Architecture (DNA), MDP, VoMP, Rhizome, MeshMS, etc.
http://servalproject.org
Other
170 stars 81 forks source link

Using `GET /restful/keyring/SID` Endpoint breaks keyring #137

Closed CryptoCopter closed 6 years ago

CryptoCopter commented 6 years ago

If you use the GET /restful/keyring/SID Endpoint, further requests to the keyring will fail.

To reproduce:

After this, servald needs to be restartet to access the keyring again.

Note that in order for this bug to occur, you need to supply the GET endpoint with a valid SID so that a match occurs. This seems to be caused by the call to keyring_free_identity(id) at the end of restful_keyring_get in keyring_restful.c. Removing this call seems to fix the issue.