Re: [PATCH] read-file: add variants that clear internal memory

2020-05-29 Thread Daiki Ueno
Bruno Haible writes: >> On a different note, it was suggested to disable stdio buffering if >> RF_SENSITIVE is set. I am attaching a patch for this. > > Reading from a regular file in an unbuffered way can be terribly slow. > But here, fread_file reads in large chunks, therefore it's OK. > >

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-29 Thread Bruno Haible
Hi Daiki, > On a different note, it was suggested to disable stdio buffering if > RF_SENSITIVE is set. I am attaching a patch for this. Reading from a regular file in an unbuffered way can be terribly slow. But here, fread_file reads in large chunks, therefore it's OK. Also, in the

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-28 Thread Daiki Ueno
Bruno Haible writes: > Let me update the uses of the module 'read-file' in Gnulib. > I think the next weekly CI run would have caught this. Thank you; I completely missed those uses in Gnulib. On a different note, it was suggested to disable stdio buffering if RF_SENSITIVE is set. I am

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-28 Thread Bruno Haible
> Both has been fixed and pushed. Thank you for the review! Let me update the uses of the module 'read-file' in Gnulib. I think the next weekly CI run would have caught this. 2020-05-28 Bruno Haible Fix build errors due to read-file changes (regression from 2020-05-27). *

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-27 Thread Daiki Ueno
Bruno Haible writes: > The first one is nearly perfect. Only the NEWS entry should go into section > "User visible incompatible changes", not into section "Important general > notes". > > The second one: > - In fread_file, around line 100, you use a realloc workaround that appears > to be

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-27 Thread Bruno Haible
Hi Daiki, > Here are the two separate commits for this. The first one is nearly perfect. Only the NEWS entry should go into section "User visible incompatible changes", not into section "Important general notes". The second one: - In fread_file, around line 100, you use a realloc workaround

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-27 Thread Daiki Ueno
Bruno Haible writes: > It would be useful to first concentrate on the first part, the refactoring > that introduces flags and RF_BINARY. This would provide a patch that is easier > to review and does not have the following problems: > - internal_fread_file still exists, although fread_file is

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-26 Thread Bruno Haible
Hi Daiki, > > If you agree, I'd like to see two commits: > > 1. the introduction of the flags and RF_BINARY, > > 2. the RF_SENSITIVE flag. > > > > Do you want me to code the first commit, or do you want to do it? > > Sure, that would make things much simpler. I'm attaching a patch along >

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-26 Thread Daiki Ueno
Bruno Haible writes: > If you agree, I'd like to see two commits: > 1. the introduction of the flags and RF_BINARY, > 2. the RF_SENSITIVE flag. > > Do you want me to code the first commit, or do you want to do it? Sure, that would make things much simpler. I'm attaching a patch along these

Re: [PATCH] read-file: add variants that clear internal memory

2020-05-26 Thread Bruno Haible
Hi Daiki, > The functions provided by the read-file module are handy, but they are > suboptimal for reading sensitive materials, because they do not clear > the allocated memory blocks upon failure. > ... > It's tempting to make this behavior enabled by default, but I worry that > it may cause