Minor tweaks, and fixed one potential memory allocation issue discovered with valgrind.
git-svn-id: file:///home/mbr/svn/fwknop/trunk@35 510a4753-2344-4c79-9c09-4d669213fbeb
This commit is contained in:
+2
-11
@@ -1,13 +1,4 @@
|
||||
CLEANFILES = libfko.info
|
||||
|
||||
info_TEXINFOS = libfko.texi
|
||||
libfko_TEXINFOS = gpl-2.0.texi
|
||||
|
||||
SUFFIXES = .html
|
||||
|
||||
html_docs = libfko.html
|
||||
|
||||
.texi.html:
|
||||
$(MAKEINFO) --html $<
|
||||
|
||||
.PHONY: html
|
||||
html: version.texi $(html_docs)
|
||||
|
||||
|
||||
+1
-1
@@ -363,7 +363,7 @@ is base64-encoded before it is added to the @acronym{SPA} data.
|
||||
Currently, libfko support the same three message digests as fwknop. These
|
||||
are (in order of strength):
|
||||
|
||||
@deftypevar enum fko_digest_type_t
|
||||
@deftypevar int fko_digest_type_t
|
||||
@table @code
|
||||
@item FKO_DIGEST_MD5
|
||||
@item FKO_DIGEST_SHA1
|
||||
|
||||
@@ -117,7 +117,7 @@ fko_encrypt_spa_data(fko_ctx_t ctx, const char *enc_key)
|
||||
|
||||
/* Now make a bucket for the base64-encoded version and populate it.
|
||||
*/
|
||||
b64cipher = malloc(((cipher_len / 3) * 4) + 4);
|
||||
b64cipher = malloc(((cipher_len / 3) * 4) + 8);
|
||||
if(b64cipher == NULL)
|
||||
return(FKO_ERROR_MEMORY_ALLOCATION);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* $Id$
|
||||
*****************************************************************************
|
||||
*
|
||||
* File: sha256.h
|
||||
* File: sha.h
|
||||
*
|
||||
* Purpose: Header for sha.c
|
||||
*
|
||||
@@ -25,12 +25,18 @@
|
||||
*
|
||||
*****************************************************************************
|
||||
*/
|
||||
#ifndef SHA256_H
|
||||
#define SHA256_H 1
|
||||
#ifndef SHA_H
|
||||
#define SHA_H 1
|
||||
|
||||
#include <endian.h>
|
||||
#include "fko_common.h"
|
||||
|
||||
/* Truncate to 32 bits -- should be a null op on 32-bit machines
|
||||
*/
|
||||
#ifndef TRUNC32
|
||||
#define TRUNC32(x) ((x) & 0xffffffffL)
|
||||
#endif
|
||||
|
||||
/* This should be fine for most systems (hopefully).
|
||||
*/
|
||||
#define BYTEORDER __BYTE_ORDER
|
||||
@@ -59,4 +65,4 @@ void sha256_update(SHA_INFO *sha_info, uint8 *buffer, int count);
|
||||
void sha256_final(SHA_INFO *sha_info);
|
||||
void sha256_unpackdigest(uint8 digest[SHA256_DIGESTSIZE], SHA_INFO *sha_info);
|
||||
|
||||
#endif /* SHA256_H */
|
||||
#endif /* SHA_H */
|
||||
|
||||
@@ -27,10 +27,6 @@
|
||||
*/
|
||||
#include "sha.h"
|
||||
|
||||
/* Truncate to 32 bits -- should be a null op on 32-bit machines
|
||||
*/
|
||||
#define TRUNC32(x) ((x) & 0xffffffffL)
|
||||
|
||||
/* 32-bit rotate to the RIGHT
|
||||
*/
|
||||
#define ROT32(x,n) TRUNC32(((x >> n) | (x << (32 - n))))
|
||||
|
||||
Reference in New Issue
Block a user