View Issue Details

IDProjectCategoryView StatusLast Update
0007106GNUnetutil librarypublic2021-11-23 21:46
Reporteroec Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product VersionGit master 
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

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-11-23 21:46 oec New Issue
2021-11-23 21:46 oec Tag Attached: Taler