Mailing List Archive

Help with "config.h file not found error" on Gnupg version 1.4.13
Hi all,
As in exercise in understanding Cybersecurity in IoT better, I'm trying to
implement the flush-reload attack from the paper "FLUSH+RELOAD: A High
Resolution, Low Noise, L3 Cache Side-Channel Attack". The crux of the
attack is to extract the private key of RSA encryption used in Gnupg. One
of the steps to initiate the attack is to find certain memory addresses to
feed to a spy function. For that I'm trying to open a C executable in Gnu
debugger(gdb). The program is part of the Gnupg 1.4.13 version. My aim is
to get the memory address of a particular function by setting breakpoint at
that line. While compiling the c program using **gcc -g mpi-pow.c**, (And
yes I tried without the -g option) I'm getting this error:






*mpi-pow.c:28:10: fatal error: config.h: No such file or directory 28
| #include <config.h> | ^~~~~~~~~~ compilation
terminated*



These were the exact steps I did:-->


1. - Extracted the Gnupg source code using tar xjvf gnupg-1.4.13.tar.bz2
2. - cd gnupg-1.4.13/
3. - ./configure
4. - sudo make
5. - sudo make install


The source code of Gnupg 1.4.13 is at Link_to_code
<http://www.ring.gr.jp/pub/net/gnupg/gnupg/>
The original paper is here Link_to_paper
<https://eprint.iacr.org/2013/448.pdf>

A quick google search told me that "In computing, configuration files
(commonly known simply as config files) are files used to configure the
parameters and initial settings for some computer programs". *And as far as
I understood, the config file is made when the "./configure" command is run
and in this case, it simply means there is no config.h file in the current
directory*. There were no errors during the compilation of Gnupg.

I'm using the Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz processor.
I tried it on WSL and on Ubuntu 20.04 installed on dual boot.

1. What might be the reason ?
2. How can I rectify this error ?

Any help would be highly appreciated.
Re: Help with "config.h file not found error" on Gnupg version 1.4.13 [ In reply to ]
You will have much better luck if you send only plain-text emails to
this list. Some of the people you'd really like to see your email
refuse to read HTML email, on the grounds that it's a security risk.
I've quoted your entire message below as plaintext to help you reach
these people.

To resolve your problem I'd suggest finding where the Automake-created
config.h header file lies, and including that directory in your GCC
invocation by using the -I flag.

Hope this helps. :)

On 3/30/2022 1:21 AM, Francis Kp via Gnupg-users wrote:
> Hi all,
> As in exercise in understanding Cybersecurity in IoT better, I'm trying
> to implement the flush-reload attack from the paper "FLUSH+RELOAD: A
> High Resolution, Low Noise, L3 Cache Side-Channel Attack". The crux of
> the attack is to extract the private key of RSA encryption used in
> Gnupg. One of the steps to initiate the attack is to find certain memory
> addresses to feed to a spy function. For that I'm trying to open a C
> executable in Gnu debugger(gdb). The program is part of the Gnupg 1.4.13
> version. My aim is to get the memory address of a particular function by
> setting breakpoint at that line. While compiling the c program using
> **gcc -g mpi-pow.c**, (And yes I tried without the -g option) I'm
> getting this error:
>
>
>
> *mpi-pow.c:28:10: fatal error: config.h: No such file or directory
>        28 | #include <config.h>
>           |          ^~~~~~~~~~
>     compilation terminated*
>
>
>
> These were the exact steps I did:-->
>
> 1.  - Extracted the Gnupg source code using tar xjvf gnupg-1.4.13.tar.bz2
> 2.  - cd gnupg-1.4.13/
> 3.  - ./configure
> 4.  - sudo make
> 5.  - sudo make install
>
>
> The source code of Gnupg 1.4.13 is at Link_to_code
> <http://www.ring.gr.jp/pub/net/gnupg/gnupg/>
> The original paper is here Link_to_paper
> <https://eprint.iacr.org/2013/448.pdf>
>
> A quick google search told me that "In computing, configuration files
> (commonly known simply as config files) are files used to configure the
> parameters and initial settings for some computer programs". /And as far
> as I understood, the config file is made when the "./configure" command
> is run and in this case, it simply means there is no config.h file in
> the current directory/. There were no errors during the compilation of
> Gnupg.
>
> I'm using the Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz processor.
> I tried it on WSL and on Ubuntu 20.04 installed on dual boot.
>
>  1. What might be the reason ?
>  2. How can I rectify this error ?
>
> Any help would be highly appreciated.
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> https://lists.gnupg.org/mailman/listinfo/gnupg-users

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Help with "config.h file not found error" on Gnupg version 1.4.13 [ In reply to ]
First of all, thank you for taking your time to reply to this email. I
tried it using the -l flag. The config file was found in the directory
before that. Below is the command I executed.

$ gcc -I /home/user/Desktop/gnupg-1.4.13
-l/home/user/Desktop/gnupg-1.4.13 mpi-pow.c

Now it's throwing the below error

>In file included from mpi-pow.c:32:
>mpi-internal.h:32:10: fatal error: mpi.h: No such file or directory
> 32 | #include "mpi.h"
> | ^~~~~~~
>compilation terminated.

I tried copying the header file mpi.h into the directory gnupg-1.4.13
and compiling the mpi-pow.c program, now the error is like given
below:

>In file included from mpi-internal.h:32,
> from mpi-pow.c:32:
>mpi.h:34:10: fatal error: iobuf.h: No such file or directory
> 34 | #include "iobuf.h"
> | ^~~~~~~~~

Is there anything wrong with the way I used the -l flag ? If so could
anyone guide me in the right direction?

On Wed, 30 Mar 2022 at 21:19, Robert J. Hansen via Gnupg-users
<gnupg-users@gnupg.org> wrote:
>
> You will have much better luck if you send only plain-text emails to
> this list. Some of the people you'd really like to see your email
> refuse to read HTML email, on the grounds that it's a security risk.
> I've quoted your entire message below as plaintext to help you reach
> these people.
>
> To resolve your problem I'd suggest finding where the Automake-created
> config.h header file lies, and including that directory in your GCC
> invocation by using the -I flag.
>
> Hope this helps. :)
>
> On 3/30/2022 1:21 AM, Francis Kp via Gnupg-users wrote:
> > Hi all,
> > As in exercise in understanding Cybersecurity in IoT better, I'm trying
> > to implement the flush-reload attack from the paper "FLUSH+RELOAD: A
> > High Resolution, Low Noise, L3 Cache Side-Channel Attack". The crux of
> > the attack is to extract the private key of RSA encryption used in
> > Gnupg. One of the steps to initiate the attack is to find certain memory
> > addresses to feed to a spy function. For that I'm trying to open a C
> > executable in Gnu debugger(gdb). The program is part of the Gnupg 1.4.13
> > version. My aim is to get the memory address of a particular function by
> > setting breakpoint at that line. While compiling the c program using
> > **gcc -g mpi-pow.c**, (And yes I tried without the -g option) I'm
> > getting this error:
> >
> >
> >
> > *mpi-pow.c:28:10: fatal error: config.h: No such file or directory
> > 28 | #include <config.h>
> > | ^~~~~~~~~~
> > compilation terminated*
> >
> >
> >
> > These were the exact steps I did:-->
> >
> > 1. - Extracted the Gnupg source code using tar xjvf gnupg-1.4.13.tar.bz2
> > 2. - cd gnupg-1.4.13/
> > 3. - ./configure
> > 4. - sudo make
> > 5. - sudo make install
> >
> >
> > The source code of Gnupg 1.4.13 is at Link_to_code
> > <http://www.ring.gr.jp/pub/net/gnupg/gnupg/>
> > The original paper is here Link_to_paper
> > <https://eprint.iacr.org/2013/448.pdf>
> >
> > A quick google search told me that "In computing, configuration files
> > (commonly known simply as config files) are files used to configure the
> > parameters and initial settings for some computer programs". /And as far
> > as I understood, the config file is made when the "./configure" command
> > is run and in this case, it simply means there is no config.h file in
> > the current directory/. There were no errors during the compilation of
> > Gnupg.
> >
> > I'm using the Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz processor.
> > I tried it on WSL and on Ubuntu 20.04 installed on dual boot.
> >
> > 1. What might be the reason ?
> > 2. How can I rectify this error ?
> >
> > Any help would be highly appreciated.
> >
> > _______________________________________________
> > Gnupg-users mailing list
> > Gnupg-users@gnupg.org
> > https://lists.gnupg.org/mailman/listinfo/gnupg-users
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> https://lists.gnupg.org/mailman/listinfo/gnupg-users

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Help with "config.h file not found error" on Gnupg version 1.4.13 [ In reply to ]
Francis Kp via Gnupg-users wrote:
> First of all, thank you for taking your time to reply to this email. I
> tried it using the -l flag. The config file was found in the directory
> before that. Below is the command I executed.
>
> $ gcc -I /home/user/Desktop/gnupg-1.4.13
> -l/home/user/Desktop/gnupg-1.4.13 mpi-pow.c
>
> Now it's throwing the below error
>
> [...]
> I tried copying the header file mpi.h into the directory gnupg-1.4.13
> and compiling the mpi-pow.c program, now the error is like given
> below:
>
> [...]
> Is there anything wrong with the way I used the -l flag ? If so could
> anyone guide me in the right direction?
>

Yes, you should remove the copy of mpi.h you made in
/home/user/Desktop/gnupg-1.4.13; that is not how you make libraries
available to C compilations. Try
-I/home/user/Desktop/gnupg-1.4.13/include instead of copying mpi.h.

If you are having to ask for help with these problems, I am not sure you
have the prerequisite programming skills to be doing this. I think you
need to learn more about C, compilation and linking, and other fairly
basic computer science topics before trying to study cybersecurity, lest
you become another entertaining "security" clown who has no clue how
computers actually work but thinks that signed integers are magically
more secure. (Hint: "signed" and "unsigned" in C have nothing to do
with cryptographic signatures whatsoever.)


-- Jacob

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Help with "config.h file not found error" on Gnupg version 1.4.13 [ In reply to ]
> First of all, thank you for taking your time to reply to this email. I
> tried it using the -l flag. The config file was found in the directory
> before that. Below is the command I executed.

I don't want to sound dismissive or discouraging, but you may want to
consider whether you have the necessary C skills for the task you're
undertaking. Learning C development is difficult; learning
cybersecurity is difficult; doing both at the same time borders on the
impossible.

> I tried copying the header file mpi.h into the directory gnupg-1.4.13
> and compiling the mpi-pow.c program, now the error is like given
> below:

The easiest way to find all the directories you need to include is to
take a look at the Autotools build script. GnuPG was never meant to be
compiled by hand, file-by-file. Instead, there's an automated system to
do it, and you can learn everything you need about how to build an
individual file by studying this system. Again, it's something you
learn in the course of becoming a C developer.

> Is there anything wrong with the way I used the -l flag ? If so could
> anyone guide me in the right direction?

This is a compile-time (include file location) problem, not a link-time
(library file location) problem. Again: something discovered in the
course of becoming a C developer.

Have you considered reaching out to the FLUSH+RELOAD paper authors, to
see if they have a pre-built binary they might be willing to share with
you? It would be a heck of a lot faster than learning enough C to
implement your own FLUSH+RELOAD on GnuPG.

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users