Commit 94b5710a authored by Per Cederqvist's avatar Per Cederqvist

patch use-nettle.patch

parent ad28f74a
refactor-cached_get_text-part-2
import-nettle
From: Per Cederqvist <ceder@lysator.liu.se>
Subject: This file adds 3 source files from http://www.lysator.liu.se/~nisse/archive/nettle-1.15.tar.gz under different names.
Original name lyskomd name
macros.h src/server/nettle-macros.h
sha.h src/server/nettle-sha.h
sha256.c src/server/nettle-sha256.c
Subject: patch use-nettle.patch
......@@ -148,7 +148,8 @@ GENOBJS = connections.c log.c $(ATOMS) \
NODIST_DISKOBJS = version-info.c
DISKOBJS = ramkomd.c ram-smalloc.c simple-cache.c ram-parse.c ram-output.c \
disk-end-of-atomic.c cache-node.c string-malloc.c \
text-store.c text-store.h
text-store.c text-store.h hashwrap.h hashwrap.c \
nettle-sha.h nettle-macros.h nettle-sha256.c
# Files for dbck.
......@@ -156,7 +157,8 @@ GETOPT = getopt.c getopt1.c
NODIST_DBCK = version-info.c
DBCK = dbck.c dbck-cache.c ram-smalloc.c ram-parse.c server-config.c \
ram-io.c ram-output.c memory.c conf-file.c $(GETOPT) \
local-to-global.c lockdb.h lockdb.c server-time.c text-store.c
local-to-global.c lockdb.h lockdb.c server-time.c text-store.c \
hashwrap.c nettle-sha256.c
# Files for encrypt (a program to transform the database from unencrypted
# apasswords to encrypted). No longer supported.
......
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "s-string.h"
#include "hashwrap.h"
#include "nettle-sha.h"
void
compute_sha256_sum(unsigned char *sha256_sum,
const String message)
{
struct sha256_ctx ctx;
sha256_init(&ctx);
sha256_update(&ctx, s_strlen(message), message.string);
sha256_digest(&ctx, 256/8, sha256_sum);
}
void compute_sha256_sum(unsigned char *sha256_sum, const String message);
......@@ -26,7 +26,7 @@
#ifndef NETTLE_SHA_H_INCLUDED
#define NETTLE_SHA_H_INCLUDED
#include "nettle-types.h"
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
......
......@@ -35,9 +35,9 @@
#include <stdlib.h>
#include <string.h>
#include "sha.h"
#include "nettle-sha.h"
#include "macros.h"
#include "nettle-macros.h"
/* A block, treated as a sequence of 32-bit words. */
#define SHA256_DATA_LENGTH 16
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment