View Issue Details

IDProjectCategoryView StatusLast Update
0007106GNUnetutil librarypublic2026-01-25 14:10
Reporteroec Assigned Tooec Due Date
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Fixed in Version0.16.0 
Summary0007106: GNUNET_CRYPTO_eddsa_key_from_file always creates file if it doesn't exist (ignoring second argument)
DescriptionThe function tries to read the content of the given filename:

  140 enum GNUNET_GenericReturnValue
  141 GNUNET_CRYPTO_eddsa_key_from_file (const char *filename,
  142 int do_create,
  143 struct GNUNET_CRYPTO_EddsaPrivateKey *pkey)
  144 {
  145 enum GNUNET_GenericReturnValue ret;
  146
  147 if (GNUNET_OK ==
  148 read_from_file (filename,
  149 pkey,
  150 sizeof (*pkey)))
  151 {
  152 /* file existed, report that we didn't create it... */
  153 return (do_create) ? GNUNET_NO : GNUNET_OK;
  154 }

... but if the file doesn't exist it ignores the flag do_create and always creates the file:

  155
  156 GNUNET_CRYPTO_eddsa_key_create (pkey);
  157 ret = GNUNET_DISK_fn_write (filename,
  158 pkey,
  159 sizeof (*pkey),
  160 GNUNET_DISK_PERM_USER_READ);
Steps To ReproduceCaught during setup of GNU Taler auditor code. The bug is triggered by _not_ having a file ~/.local/share/taler/auditor/offline-keys/auditor.priv and calling /usr/bin/taler-helper-auditor-coins.
TagsNo tags attached.

Activities

oec

2021-12-15 13:34

developer   ~0018577

Fixed with f27fe484c60be69e762e038a84331a3a72111957

oec

2021-12-15 13:35

developer   ~0018578

Fixed with f27fe484c60be69e762e038a84331a3a72111957

schanzen

2022-02-26 22:10

administrator   ~0018732

0.16.0 released

Issue History

Date ModifiedUsernameFieldChange
2021-11-23 20:46oecNew Issue
2021-11-23 20:46oecTag Attached: Taler
2021-12-14 16:32Christian GrothoffAssigned To => oec
2021-12-14 16:32Christian GrothoffStatusnew => assigned
2021-12-15 13:34oecNote Added: 0018577
2021-12-15 13:35oecStatusassigned => resolved
2021-12-15 13:35oecResolutionopen => fixed
2021-12-15 13:35oecFixed in Version => Git master
2021-12-15 13:35oecNote Added: 0018578
2022-02-22 22:05schanzenFixed in VersionGit master => 0.16.0
2022-02-26 22:10schanzenNote Added: 0018732
2022-02-26 22:10schanzenStatusresolved => closed
2026-01-25 14:10Christian GrothoffTag Detached: Taler