View Issue Details

IDProjectCategoryView StatusLast Update
0007106GNUnetutil librarypublic2022-02-26 23:10
Reporteroec Assigned Tooec  
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.
TagsTaler

Activities

oec

2021-12-15 14:34

developer   ~0018577

Fixed with f27fe484c60be69e762e038a84331a3a72111957

oec

2021-12-15 14:35

developer   ~0018578

Fixed with f27fe484c60be69e762e038a84331a3a72111957

schanzen

2022-02-26 23:10

manager   ~0018732

0.16.0 released

Issue History

Date Modified Username Field Change
2021-11-23 21:46 oec New Issue
2021-11-23 21:46 oec Tag Attached: Taler
2021-12-14 17:32 Christian Grothoff Assigned To => oec
2021-12-14 17:32 Christian Grothoff Status new => assigned
2021-12-15 14:34 oec Note Added: 0018577
2021-12-15 14:35 oec Status assigned => resolved
2021-12-15 14:35 oec Resolution open => fixed
2021-12-15 14:35 oec Fixed in Version => Git master
2021-12-15 14:35 oec Note Added: 0018578
2022-02-22 23:05 schanzen Fixed in Version Git master => 0.16.0
2022-02-26 23:10 schanzen Note Added: 0018732
2022-02-26 23:10 schanzen Status resolved => closed