Bug 19295

Summary: Provides bad crypt()-function
Product: [Retired] Red Hat Linux Reporter: Enrico Scholz <rh-bugzilla>
Component: opensslAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-10-18 12:16:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2000-10-18 01:08:05 UTC
libcrypto.0.9.5a contains a crypt()  function providing only the simple DES
encrypting. But libcrypt.so (part of glibc) allows MD5 encryption
supporting larger passwords.

E.g. compiling
------- test.cc ------
#define _XOPEN_SOURCE
#include <unistd.h>
#include <iostream>

int main() {
        std::cout << crypt("ABC", "$1$abcdef$") << std::endl;
}
-------

both with -lcrypt and -lcrypto is giving different output:

# g++ /tmp/crypt.cc -lcrypt && ./a.out 
$1$abcdef$huJsPyysqd.RqgtSA1ccS.

# g++ /tmp/crypt.cc -lcrypto && ./a.out 
$1EA5T9lIorRY



So you can loss the capability to use large passwd's if OpenSSL is linked
to the program (I have seen it with cvs-1.11).

Reason seems to lie in crypto/des/fcrypt.c where crypt() is nested in a
complicated #if-#else clause. Perhaps it's fixed in OpenSSL-0.9.6 but I
have no opportunity to test it now.

Comment 1 Nalin Dahyabhai 2000-10-24 20:28:49 UTC
This will be fixed in openssl-0.9.5a-19 in Raw Hide.  Thanks!