about summary refs log tree commit diff
path: root/crypt/cert.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@owlfolio.org>2023-09-21 14:58:05 -0400
committerZack Weinberg <zack@owlfolio.org>2023-09-21 16:24:59 -0400
commit46e817c4982dfda6aaf6863c141b2e56cfc75acd (patch)
tree7adb7aafbfc6d34a79cb729babfb4786996f9ce2 /crypt/cert.c
parent0a19410103c1c4890753596e294438786fa13a8c (diff)
downloadglibc-46e817c4982dfda6aaf6863c141b2e56cfc75acd.tar.gz
glibc-46e817c4982dfda6aaf6863c141b2e56cfc75acd.tar.xz
glibc-46e817c4982dfda6aaf6863c141b2e56cfc75acd.zip
Remove all of the remaining libcrypt code. zack/remove-libcrypt
Completing the removal of libcrypt, delete all of its actual code.
This patch contains only file removals:

git rm -r crypt
git rm include/crypt.h
git rm $(find sysdeps -name libcrypt.abilist)
git rm $(find sysdeps -name fips-private.h)
git rm $(find sysdeps -name 'md5-*' -o -name 'sha256-*' -o -name 'sha512-*')

For this patch (not the earlier ones, I'd still be waiting) I ran the
complete testsuite and found no *new* failures.  26 tests are failing
on my machine due to probable environment issues, but they were all
failing on trunk before I started making changes, and none of them
appear to have anything to do with this patchset.
Diffstat (limited to 'crypt/cert.c')
-rw-r--r--crypt/cert.c135
1 files changed, 0 insertions, 135 deletions
diff --git a/crypt/cert.c b/crypt/cert.c
deleted file mode 100644
index 5b4277f76d..0000000000
--- a/crypt/cert.c
+++ /dev/null
@@ -1,135 +0,0 @@
-
-/*
- * This crypt(3) validation program shipped with UFC-crypt
- * is derived from one distributed with Phil Karns PD DES package.
- *
- * @(#)cert.c	1.8 11 Aug 1996
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include "crypt.h"
-
-/* This file tests the deprecated setkey/encrypt interface.  */
-#include <shlib-compat.h>
-#if TEST_COMPAT (libcrypt, GLIBC_2_0, GLIBC_2_28)
-
-#define libcrypt_version_reference(symbol, version) \
-  _libcrypt_version_reference (symbol, VERSION_libcrypt_##version)
-#define _libcrypt_version_reference(symbol, version) \
-  __libcrypt_version_reference (symbol, version)
-#define __libcrypt_version_reference(symbol, version) \
-  __asm__ (".symver " #symbol ", " #symbol "@" #version)
-
-extern void setkey (const char *);
-extern void encrypt (const char *, int);
-libcrypt_version_reference (setkey, GLIBC_2_0);
-libcrypt_version_reference (encrypt, GLIBC_2_0);
-
-int totfails = 0;
-
-int main (int argc, char *argv[]);
-void get8 (char *cp);
-void put8 (char *cp);
-void good_bye (void) __attribute__ ((noreturn));
-
-void
-good_bye (void)
-{
-  if(totfails == 0) {
-    printf("Passed DES validation suite\n");
-    exit(0);
-  } else {
-    printf("%d failures during DES validation suite!!!\n", totfails);
-    exit(1);
-  }
-}
-
-int
-main (int argc, char *argv[])
-{
-	char key[64],plain[64],cipher[64],answer[64];
-	int i;
-	int fail;
-
-	for(;!feof(stdin);){
-
-		get8(key);
-		printf(" K: "); put8(key);
-		setkey(key);
-
-		get8(plain);
-		printf(" P: "); put8(plain);
-
-		get8(answer);
-		printf(" C: "); put8(answer);
-
-		for(i=0;i<64;i++)
-			cipher[i] = plain[i];
-		encrypt(cipher, 0);
-
-		for(i=0;i<64;i++)
-			if(cipher[i] != answer[i])
-				break;
-		fail = 0;
-		if(i != 64){
-			printf(" Encrypt FAIL");
-			fail++; totfails++;
-		}
-
-		encrypt(cipher, 1);
-
-		for(i=0;i<64;i++)
-			if(cipher[i] != plain[i])
-				break;
-		if(i != 64){
-			printf(" Decrypt FAIL");
-			fail++; totfails++;
-		}
-
-		if(fail == 0)
-			printf(" OK");
-		printf("\n");
-	}
-	good_bye();
-}
-void
-get8 (char *cp)
-{
-	int i,j,t;
-
-	for(i=0;i<8;i++){
-		if (scanf("%2x",&t) < 1)
-		  {
-		    if(ferror(stdin))
-		      totfails++;
-		  }
-		if(feof(stdin))
-		  good_bye();
-		for(j=0; j<8 ; j++) {
-		  *cp++ = (t & (0x01 << (7-j))) != 0;
-		}
-	}
-}
-void
-put8 (char *cp)
-{
-	int i,j,t;
-
-	for(i=0;i<8;i++){
-	  t = 0;
-	  for(j = 0; j<8; j++)
-	    t = (t<<1) | *cp++;
-	  printf("%02x", t);
-	}
-}
-
-#else /* encrypt and setkey are not available.  */
-
-int
-main (void)
-{
-  return 77; /* UNSUPPORTED */
-}
-
-#endif