bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Re: Trying to bootstrap my project, distcheck doesn't configure
       [not found]   ` <87d02ob434.fsf@herbrand>
@ 2020-09-14 21:11     ` Bruce Korb
  2020-09-14 22:53       ` Bruno Haible
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Korb @ 2020-09-14 21:11 UTC (permalink / raw)
  To: GNU lib bugs; +Cc: Mathieu Lirzin

Sorry, Mathieu, I can now see I sent it to the wrong list.

On 9/14/20 11:33 AM, Mathieu Lirzin wrote:
I'm hitting this that I've never seen before:
>>> $ grep do_not_make_me au*bld/autoopts/Makefile.am
>>> do_not_make_me_la_LIBADD += @LTALLOCA@
>>> do_not_make_me_la_DEPENDENCIES += @LTALLOCA@
>>> EXTRA_do_not_make_me_la_SOURCES += alloca.c
>>> EXTRA_do_not_make_me_la_SOURCES += dup2.c
>>> do_not_make_me_la_SOURCES += fd-hook.c
>>> do_not_make_me_la_SOURCES += gettext.h
>>> EXTRA_do_not_make_me_la_SOURCES += msvc-inval.c
>>> EXTRA_do_not_make_me_la_SOURCES += msvc-nothrow.c
>>> EXTRA_do_not_make_me_la_SOURCES += nanosleep.c
>>> do_not_make_me_la_SOURCES += parse-duration.c
>>> EXTRA_do_not_make_me_la_SOURCES += raise.c
>>> EXTRA_do_not_make_me_la_SOURCES += select.c
>>> do_not_make_me_la_SOURCES += sig-handler.c
>>> EXTRA_do_not_make_me_la_SOURCES += sigaction.c
>>> EXTRA_do_not_make_me_la_SOURCES += sigprocmask.c
>>> do_not_make_me_la_SOURCES += sockets.h sockets.c
>>> do_not_make_me_la_SOURCES += stat-time.c
>>> do_not_make_me_la_SOURCES += sys_socket.c
>>> do_not_make_me_la_SOURCES += timespec.c
>>> do_not_make_me_la_SOURCES += unistd.c
>> which trigger error messages that I can get around by hacking in dummy
>> initial assignments, but I'm guessing that's not the intended
>> method. I need a clue, please? Thank you.

It seems that gnulib-tool inserts these into my Makefile.am, but doesn't 
insert the initial plain assignment. I have no idea what new ones may 
crop up, so I've added a "##FIX-DO-NOT-MAKE-ME" line to my 
Makefile.am's. That gets fixed by figuring out which ones get 
automatically inserted. e.g.:

> BUILT_SOURCES          =
> MOSTLYCLEANFILES    =
> EXTRA_do_not_make_me_la_SOURCES =
> do_not_make_me_la_DEPENDENCIES  =
> do_not_make_me_la_LIBADD        =
> do_not_make_me_la_SOURCES       =

But I still have confusing problems:

> autoopts/Makefile.am:33: warning: variable 
> 'EXTRA_do_not_make_me_la_SOURCES' is defined but no program or
> autoopts/Makefile.am:33: library has 'do_not_make_me_la' as canonical 
> name (possible typo)
> autoopts/Makefile.am:36: warning: variable 'do_not_make_me_la_SOURCES' 
> is defined but no program or
> autoopts/Makefile.am:36: library has 'do_not_make_me_la' as canonical 
> name (possible typo)
> autoopts/Makefile.am:35: warning: variable 'do_not_make_me_la_LIBADD' 
> is defined but no program or
> autoopts/Makefile.am:35: library has 'do_not_make_me_la' as canonical 
> name (possible typo)
> autoopts/Makefile.am:34: warning: variable 
> 'do_not_make_me_la_DEPENDENCIES' is defined but no program or
> autoopts/Makefile.am:34: library has 'do_not_make_me_la' as canonical 
> name (possible typo)
> doc/Makefile.am:40: installing 'config/texinfo.tex'

and I have no obvious workaround for it. And Googling 'gnulib 
do_not_make_me' yields nothing.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Trying to bootstrap my project, distcheck doesn't configure
  2020-09-14 21:11     ` Trying to bootstrap my project, distcheck doesn't configure Bruce Korb
@ 2020-09-14 22:53       ` Bruno Haible
  2020-09-15 14:16         ` Bruce Korb
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Haible @ 2020-09-14 22:53 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Mathieu Lirzin

Hi Bruce,

It would help if you would give a pointer to the source code you are
trying to bootstrap. Because a single line in Makefile.am or configure.ac
can have a big effect.

> >>> do_not_make_me_la_SOURCES += timespec.c
> >>> do_not_make_me_la_SOURCES += unistd.c
> >> which trigger error messages that I can get around by hacking in dummy
> >> initial assignments, but I'm guessing that's not the intended
> >> method. I need a clue, please? Thank you.
> 
> It seems that gnulib-tool inserts these into my Makefile.am, but doesn't 
> insert the initial plain assignment. I have no idea what new ones may 
> crop up

It is documented here:
https://www.gnu.org/software/gnulib/manual/html_node/Modified-build-rules.html

Bruno



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Trying to bootstrap my project, distcheck doesn't configure
  2020-09-14 22:53       ` Bruno Haible
@ 2020-09-15 14:16         ` Bruce Korb
  2020-09-18 15:58           ` gc-pbkdf2-sha1 is deprecated Bruce Korb
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Korb @ 2020-09-15 14:16 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib

Hi Bruno,

On 9/14/20 3:53 PM, Bruno Haible wrote:
> Hi Bruce,
>
> It would help if you would give a pointer to the source code you are
> trying to bootstrap. Because a single line in Makefile.am or configure.ac
> can have a big effect.

It lives on my home machine while I try to get it ready for prime time. 
As you may recollect, autogen is a monster. You can pull a copy from 
GNU's git repo, if you're interested: 
https://savannah.gnu.org/git/?group=autogen

> It is documented here:
> https://www.gnu.org/software/gnulib/manual/html_node/Modified-build-rules.html

Apparently, somewhere along the line I added "--lib=do_not_make_me". 
That had to have been years ago and I have no recollection of adding 
that. Anyway, that triggered some do_not_make_me_la_SOURCE += whatever 
stuff, which was not added previously. I have no idea how those names 
get selected, but after a grep, sed and unique sort, I came up with this 
list:

> EXTRA_do_not_make_me_la_SOURCES =
> do_not_make_me_la_DEPENDENCIES  =
> do_not_make_me_la_LIBADD        =
> do_not_make_me_la_SOURCES       =
These aren't documented on that page. I googled for "do_not_make_me" and 
got no results, tho were I to do it today, I'd likely get this email 
thread. :) Anyway, I am gathering from reading what you've pointed to 
that the grep/sed/sort accommodation is the right solution. Thank you.

Regards, Bruce

For your possible (unlikely?) entertainment:
> fix_do_not_make_me() {
>     local fix_list=$(
>         grep -l FIX-DO-NOT-MAKE-ME \
>              $(find * -type f -name 'Makefile.am'))
>     local sedcmd= vlist= f= v=
>
>     for f in $fix_list
>     do
>         sedcmd=$'/^##* *FIX-DO-NOT-MAKE-ME/ {\ns/.*//\n'
>         vlist=$(sed -n '/do_not_make_me/s/ *[+=].*//p' $f | \
>                     sort -u)
>         if test ${#vlist} -gt 1
>         then
>             sedcmd+=$'i\\\n'
>             for v in $vlist
>             do
>                 sedcmd+="$(printf '%-32s=' $v)"$'\\\n'
>             done
>             sedcmd+=$'\n'
>         fi
>         sedcmd+='}'
>
>         sed "$sedcmd" $f > $f.make-me-fixed
>         mv -f $f.make-me-fixed $f
>     done
> }



^ permalink raw reply	[flat|nested] 9+ messages in thread

* gc-pbkdf2-sha1 is deprecated
  2020-09-15 14:16         ` Bruce Korb
@ 2020-09-18 15:58           ` Bruce Korb
  2020-09-18 16:32             ` Bruno Haible
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Korb @ 2020-09-18 15:58 UTC (permalink / raw)
  To: bug-gnulib

Hi Bruno, et al.,

Next question: what do I do about crypto/gc-pbkdf2-sha1? It is labeled 
as "deprecated", but I need a function that produces precisely the same 
result. It really doesn't matter to me that folks have figured out how 
to jigger a file to produce an arbitrary sha1 sum. I only need a fairly 
random result from summing a few tens of bytes of text. So as long as 
"deprecate" doesn't mean it's going away, I'm fine. I use the code to 
create an unguessable password. Just because it's possible to use 
different source text to produce the same password doesn't matter at all. :)

Cheers - Bruce




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gc-pbkdf2-sha1 is deprecated
  2020-09-18 15:58           ` gc-pbkdf2-sha1 is deprecated Bruce Korb
@ 2020-09-18 16:32             ` Bruno Haible
  2020-09-21 22:49               ` Bruce Korb
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Haible @ 2020-09-18 16:32 UTC (permalink / raw)
  To: bug-gnulib

Hi Bruce,

> Next question: what do I do about crypto/gc-pbkdf2-sha1? It is labeled 
> as "deprecated", but I need a function that produces precisely the same 
> result. It really doesn't matter to me that folks have figured out how 
> to jigger a file to produce an arbitrary sha1 sum. I only need a fairly 
> random result from summing a few tens of bytes of text. So as long as 
> "deprecate" doesn't mean it's going away, I'm fine.

It may go away, because the module crypto/gc-pbkdf2 contains more generic
API to do the same thing: gc_pbkdf2_hmac with first argument GC_SHA1.

Bruno



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gc-pbkdf2-sha1 is deprecated
  2020-09-18 16:32             ` Bruno Haible
@ 2020-09-21 22:49               ` Bruce Korb
  2020-09-22 15:04                 ` Bruce Korb
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Korb @ 2020-09-21 22:49 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib

gnu-pw-mgr fatal error:
gc_pbkdf2_hmac returned error code 5

(5 --> GC_INVALID_HASH)

I think they work differently.


     rc = gc_pbkdf2_hmac(GC_SHA1,
                         hash_source, hash_src_len,
                         salt,        salt_len,
                         OPT_VALUE_PBKDF2,// <-- pbkdf2 reprocessing count
                         hash_output, hash_out_len);
     if (rc != GC_OK)
         die(GNU_PW_MGR_EXIT_INVALID, pbkdf2_err_fmt, rc);

On 9/18/20 9:32 AM, Bruno Haible wrote:
> Hi Bruce,
>
>> Next question: what do I do about crypto/gc-pbkdf2-sha1? It is labeled
>> as "deprecated", but I need a function that produces precisely the same
>> result. It really doesn't matter to me that folks have figured out how
>> to jigger a file to produce an arbitrary sha1 sum. I only need a fairly
>> random result from summing a few tens of bytes of text. So as long as
>> "deprecate" doesn't mean it's going away, I'm fine.
> It may go away, because the module crypto/gc-pbkdf2 contains more generic
> API to do the same thing: gc_pbkdf2_hmac with first argument GC_SHA1.
>
> Bruno
>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gc-pbkdf2-sha1 is deprecated
  2020-09-21 22:49               ` Bruce Korb
@ 2020-09-22 15:04                 ` Bruce Korb
  2020-09-22 17:03                   ` Bruno Haible
  0 siblings, 1 reply; 9+ messages in thread
From: Bruce Korb @ 2020-09-22 15:04 UTC (permalink / raw)
  To: Bruno Haible, bug-gnulib

Hi Bruno, et al.,

The failing difference isn't whether or not I use gc_pbkdf2_hmac vs. 
gc_pbkdf2_sha1, the failing difference is whether or not I specify the 
crypto/gc-pbkdf2-sha1 module vs. the crypto/gc-pbkdf2 module. The former 
works, the latter does not, with the rest of my project entirely 
unchanged. Feel free to test it, assuming you have the autogen suite for 
bootstrapping:

[remote "origin"]
         url = bkorb@git.savannah.gnu.org:/srv/git/gnu-pw-mgr.git

Without specifying the "-sha1" module, the make check fails with the 
pbkdf2 function returning 5. Here's the patch that causes the project to 
fail:

diff --git a/bootstrap.conf b/bootstrap.conf
index b0e397a..7703c6f 100755
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -90,7 +90,7 @@ initialize() {
      gnulib_modules='
          base64              \
          close               \
-        crypto/gc-pbkdf2-sha1 \
+        crypto/gc-pbkdf2      \
          crypto/gc-random    \
          crypto/sha256       \
          ctype               \

and it yields this error message:

+++T=gpw-53> /u/bkorb/tools/gnu-pw-mgr-bld/src/gnu-pw-mgr 
--config-file=/tmp/gpw-3tsXGB/.local/gnupwmgr.cfg --rehash=1 -i test-tag who
gnu-pw-mgr fatal error:
gc_pbkdf2_sha1 returned error code 5

On 9/21/20 3:49 PM, Bruce Korb wrote:
>> It may go away, because the module crypto/gc-pbkdf2 contains more 
>> generic API to do the same thing: gc_pbkdf2_hmac with first argument 
>> GC_SHA1.
>>
>> Bruno
>>
>>
>
>


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: gc-pbkdf2-sha1 is deprecated
  2020-09-22 15:04                 ` Bruce Korb
@ 2020-09-22 17:03                   ` Bruno Haible
  2020-09-23 16:55                     ` gc-pbkdf2-sha1 must not be deprecated Bruce Korb
  0 siblings, 1 reply; 9+ messages in thread
From: Bruno Haible @ 2020-09-22 17:03 UTC (permalink / raw)
  To: Bruce Korb; +Cc: bug-gnulib

Hi Bruce,

> The failing difference isn't whether or not I use gc_pbkdf2_hmac vs. 
> gc_pbkdf2_sha1, the failing difference is whether or not I specify the 
> crypto/gc-pbkdf2-sha1 module vs. the crypto/gc-pbkdf2 module.

I'm not really familiar with these. Does the libgcrypt documentation help,
maybe?

Bruno



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: gc-pbkdf2-sha1 must not be deprecated
  2020-09-22 17:03                   ` Bruno Haible
@ 2020-09-23 16:55                     ` Bruce Korb
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Korb @ 2020-09-23 16:55 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib


On 9/22/20 10:03 AM, Bruno Haible wrote:
> I'm not really familiar with these. Does the libgcrypt documentation help,
> maybe?
>
> Bruno
I have become much more familiar that I'd really like to be. It seems 
that without the crypto/gc-pbkdf2-sha1 module defined, then 
GNULIB_GC_HMAC_SHA1 is not defined so the switch statement falls through 
to the error return. If crypto/gc-pbkdf2 provides a definition for 
GC_SHA1, then the code needs to handle it. There are legitimate uses for 
SHA1, even if it should not be used for signing files. It cannot be 
obsoleted. Ever.
> 101     Gc_rc
> 102     gc_pbkdf2_hmac (Gc_hash hash,
> 103                     const char *P, size_t Plen,
> 104                     const char *S, size_t Slen,
> (gdb)
> 105                     unsigned int c, char *DK, size_t dkLen)
> 106     {
> 107       gc_prf_func prf;
> 108       size_t hLen;
> 109
> 110       switch (hash)
> 111         {
> 112     #if GNULIB_GC_HMAC_SHA1
> 113         case GC_SHA1:
> 114           prf = gc_hmac_sha1;
> (gdb)
> 115           hLen = GC_SHA1_DIGEST_SIZE;
> 116           break;
> 117     #endif
> 118
> 119     #if GNULIB_GC_HMAC_SHA256
> 120         case GC_SHA256:
> 121           prf = gc_hmac_sha256;
> 122           hLen = GC_SHA256_DIGEST_SIZE;
> 123           break;
> 124     #endif
> (gdb)
> 125
> 126     #if GNULIB_GC_HMAC_SHA512
> 127         case GC_SHA512:
> 128           prf = gc_hmac_sha512;
> 129           hLen = GC_SHA512_DIGEST_SIZE;
> 130           break;
> 131     #endif
> 132
> 133         default:
> 134           return GC_INVALID_HASH;
> (gdb)
> 135         }
> 136
> 137       return gc_pbkdf2_prf (prf, hLen, P, Plen, S, Slen, c, DK, 
> dkLen);
> 138     }



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-09-23 16:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAKRnqNLXD7waxPm7h=5S2-HkAe9WMVsLDtCuNrOFy_eyJZeZBQ@mail.gmail.com>
     [not found] ` <56102afd-8924-3338-722f-da03e590dd63@gnu.org>
     [not found]   ` <87d02ob434.fsf@herbrand>
2020-09-14 21:11     ` Trying to bootstrap my project, distcheck doesn't configure Bruce Korb
2020-09-14 22:53       ` Bruno Haible
2020-09-15 14:16         ` Bruce Korb
2020-09-18 15:58           ` gc-pbkdf2-sha1 is deprecated Bruce Korb
2020-09-18 16:32             ` Bruno Haible
2020-09-21 22:49               ` Bruce Korb
2020-09-22 15:04                 ` Bruce Korb
2020-09-22 17:03                   ` Bruno Haible
2020-09-23 16:55                     ` gc-pbkdf2-sha1 must not be deprecated Bruce Korb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).