Bug 25544

Summary: [Error] fatal error: rpc/des_crypt.h: No such file or director
Product: glibc Reporter: Akhilesh <akhipatel>
Component: librtAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED INVALID    
Severity: normal CC: fweimer
Priority: P2 Flags: fweimer: security-
Version: 2.30   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:

Description Akhilesh 2020-02-13 13:44:42 UTC
Hello 

My current glibc version is 2.30. 
 
I am getting below Error with my sample test application even with my glibc is compiled with "--enable-obsolete-rpc --enable-obsolete-nsl” 

akhilesh@DELL-BUILD10:~/P4/github/glibc$ armv7l-linux-gnueabi-gcc test.c 
test.c:1:10: fatal error: rpc/des_crypt.h: No such file or directory
    1 | #include <rpc/des_crypt.h>
      |          ^~~~~~~~~~


akhilesh@DELL-BUILD10:~/P4/github/glibc$ cat test.c 

#include <rpc/des_crypt.h>
void main()
{

}
akhilesh.k@DELL-BUILD10:~/P4/github/glibc$ 


When i checked I found this is due to changes in glibc from 2.26 onwards also in scripts/build-many-glibcs.py i found both options are not added for arm  but same are added in x86 

 170         self.add_config(arch='arm',
 171                         os_name='linux-gnueabihf',
 172                         gcc_cfg=['--with-float=hard', '--with-cpu=arm926ej-s'],
 173                         extra_glibcs=[{'variant': 'v7a',
 174                                        'ccopts': '-march=armv7-a -mfpu=vfpv3'},
 175                                       {'variant': 'v7a-disable-multi-arch',
 176                                        'ccopts': '-march=armv7-a -mfpu=vfpv3',
 177                                        'cfg': ['--disable-multi-arch']}])
 178         self.add_config(arch='armeb',
 179                         os_name='linux-gnueabihf',
 180                         gcc_cfg=['--with-float=hard', '--with-cpu=arm926ej-s'])
 181         self.add_config(arch='armeb',
 182                         os_name='linux-gnueabihf',
 183                         variant='be8',
 184                         gcc_cfg=['--with-float=hard', '--with-arch=armv7-a',
 185                                  '--with-fpu=vfpv3'])
 
 Please let me know if this is intentional? Also how to resolve this issue?
Comment 1 Florian Weimer 2020-02-13 14:50:34 UTC
This is a deliberate change in glibc 2.28, as mentioned in the NEWS file:

* The obsolete functions encrypt, encrypt_r, setkey, setkey_r, cbc_crypt,
  ecb_crypt, and des_setparity are no longer available to newly linked
  binaries, and the headers <rpc/des_crypt.h> and <rpc/rpc_des.h> are no
  longer installed.  These functions encrypted and decrypted data with the
  DES block cipher, which is no longer considered secure.  Software that
  still uses these functions should switch to a modern cryptography library,
  such as libgcrypt.