Good point, I've removed the 'const' from the ego_get_anonymous() function. That solution is also not 'perfect', but should avoid the weirdness you reported.
-Christian On 7/17/20 5:20 PM, TheJackiMonster wrote: > Hi, > > I'm currently working on a library to make it easier for others to > create messengers using CADET and being compatible with each other > (proving direct chats, server-client-groupchats and decentralized > group-chats). > > Now I'm integrating EGO keys for authentication via signatures of > messages and verification but the API in C seems a little inconsistent. > > For example: > > GNUNET_IDENTITY_ego_get_anonymous() returns a const struct pointer > and > GNUNET_IDENTITY_ego_get_private_key(ego) expects a const struct pointer > for ego > > but > > GNUNET_IDENTITY_ego_get_public_key(ego, &pub_key) expects a struct > pointer for ego (so it is not possible to retrieve the public key from > the anonymous default key formally). > > I still found a solution > using GNUNET_CRYPTO_ecdsa_key_get_public(priv_key, &pub_key) but it's > definitely weird that some methods which I wouldn't expect to use any > write accesses require non-const pointer. > > Maybe this can be patched soon. I would assume, it shouldn't require > any major changes. > > Happy hacking > Jacki >
0x939E6BE1E29FC3CC.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature
