components/pwgen/patches/01-sha1num.c.patch
author Lukas Rovensky <Lukas.Rovensky@oracle.com>
Fri, 22 Apr 2016 05:13:17 -0700
changeset 5841 97e8c4dc6a82
parent 1600 936fff797203
permissions -rw-r--r--
22907390 Upgrade pwgen to version 2.07

Developed in-house, as the community seems to be back it can be
provided back upstream.

Fixes a Parfait reported issue and makes pwgen to use Solaris'
implementation of SHA1.

--- pwgen-2.07/sha1num.c.orig	Fri Apr 22 04:32:20 2016
+++ pwgen-2.07/sha1num.c	Fri Apr 22 04:45:55 2016
@@ -11,7 +11,15 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "pwgen.h"
-#include "sha1.h"
+#ifdef SHA_INTERNAL
+  #include "sha1.h"
+#elif SHA_SOLARIS
+  #include <sha1.h>
+  #define sha1_context SHA1_CTX
+  #define sha1_starts SHA1Init
+  #define sha1_update SHA1Update
+  #define sha1_finish(a,b) SHA1Final(b,a)
+#endif
 
 sha1_context sha1_ctx;
 char *sha1_seed;
@@ -54,6 +62,8 @@
 		sha1_update( &sha1_ctx, buf, i );
 	}
 
+  fclose(f);
+
 	return;
 }