Page MenuHomeFreeBSD

D9423.id24679.diff
No OneTemporary

D9423.id24679.diff

Index: sbin/hastctl/Makefile
===================================================================
--- sbin/hastctl/Makefile
+++ sbin/hastctl/Makefile
@@ -34,10 +34,6 @@
CFLAGS+=-DYY_NO_INPUT
LIBADD= util
-.if ${MK_OPENSSL} != "no"
-LIBADD+= crypto
-CFLAGS+=-DHAVE_CRYPTO
-.endif
YFLAGS+=-v
Index: sbin/hastd/Makefile
===================================================================
--- sbin/hastd/Makefile
+++ sbin/hastd/Makefile
@@ -31,11 +31,7 @@
CFLAGS+=-DINET6
.endif
-LIBADD= geom pthread util
-.if ${MK_OPENSSL} != "no"
-LIBADD+= crypto
-CFLAGS+=-DHAVE_CRYPTO
-.endif
+LIBADD= geom md pthread util
YFLAGS+=-v
Index: sbin/hastd/hast_checksum.c
===================================================================
--- sbin/hastd/hast_checksum.c
+++ sbin/hastd/hast_checksum.c
@@ -31,22 +31,15 @@
#include <string.h>
#include <strings.h>
-#ifdef HAVE_CRYPTO
-#include <openssl/sha.h>
-#endif
-
#include <crc32.h>
#include <hast.h>
#include <nv.h>
+#include <sha256.h>
#include <pjdlog.h>
#include "hast_checksum.h"
-#ifdef HAVE_CRYPTO
#define MAX_HASH_SIZE SHA256_DIGEST_LENGTH
-#else
-#define MAX_HASH_SIZE 4
-#endif
static void
hast_crc32_checksum(const unsigned char *data, size_t size,
@@ -60,7 +53,6 @@
*hsizep = sizeof(crc);
}
-#ifdef HAVE_CRYPTO
static void
hast_sha256_checksum(const unsigned char *data, size_t size,
unsigned char *hash, size_t *hsizep)
@@ -72,7 +64,6 @@
SHA256_Final(hash, &ctx);
*hsizep = SHA256_DIGEST_LENGTH;
}
-#endif /* HAVE_CRYPTO */
const char *
checksum_name(int num)
@@ -102,11 +93,9 @@
case HAST_CHECKSUM_CRC32:
hast_crc32_checksum(*datap, *sizep, hash, &hsize);
break;
-#ifdef HAVE_CRYPTO
case HAST_CHECKSUM_SHA256:
hast_sha256_checksum(*datap, *sizep, hash, &hsize);
break;
-#endif
default:
PJDLOG_ABORT("Invalid checksum: %d.", res->hr_checksum);
}
@@ -138,10 +127,8 @@
}
if (strcmp(algo, "crc32") == 0)
hast_crc32_checksum(*datap, *sizep, chash, &chsize);
-#ifdef HAVE_CRYPTO
else if (strcmp(algo, "sha256") == 0)
hast_sha256_checksum(*datap, *sizep, chash, &chsize);
-#endif
else {
pjdlog_error("Unknown checksum algorithm '%s'.", algo);
return (-1); /* Unknown checksum algorithm. */
Index: sbin/hastd/hast_proto.c
===================================================================
--- sbin/hastd/hast_proto.c
+++ sbin/hastd/hast_proto.c
@@ -42,9 +42,7 @@
#include <pjdlog.h>
#include <proto.h>
-#ifdef HAVE_CRYPTO
#include "hast_checksum.h"
-#endif
#include "hast_compression.h"
#include "hast_proto.h"
@@ -68,9 +66,7 @@
static struct hast_pipe_stage pipeline[] = {
{ "compression", compression_send, compression_recv },
-#ifdef HAVE_CRYPTO
{ "checksum", checksum_send, checksum_recv }
-#endif
};
/*

File Metadata

Mime Type
text/plain
Expires
Mon, Mar 23, 2:22 PM (3 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30189482
Default Alt Text
D9423.id24679.diff (2 KB)

Event Timeline