aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2024-01-12 18:05:13 +0000
committerMikhail Teterin <mi@FreeBSD.org>2024-01-12 18:08:25 +0000
commita7b61a78f2981dd86d947bc09e8f187d10416e57 (patch)
tree730eecaee0d9bf9c120d80bbdf14ea0ad49d7e79
parent608b6df7b3a5735879fdcc4d344d25c7687fe0fe (diff)
downloadports-a7b61a78f2981dd86d947bc09e8f187d10416e57.tar.gz
ports-a7b61a78f2981dd86d947bc09e8f187d10416e57.zip
security/pdfcrack: upgrade from 0.16 to 0.20
Changes: https://sourceforge.net/p/pdfcrack/news/ Fix-up compiler warnings in md5-code.
-rw-r--r--security/pdfcrack/Makefile3
-rw-r--r--security/pdfcrack/distinfo6
-rw-r--r--security/pdfcrack/files/patch-md588
3 files changed, 92 insertions, 5 deletions
diff --git a/security/pdfcrack/Makefile b/security/pdfcrack/Makefile
index d2879103154e..a00743f0feec 100644
--- a/security/pdfcrack/Makefile
+++ b/security/pdfcrack/Makefile
@@ -1,6 +1,5 @@
PORTNAME= pdfcrack
-PORTVERSION= 0.16
-PORTREVISION= 1
+PORTVERSION= 0.20
CATEGORIES= security print
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION}
diff --git a/security/pdfcrack/distinfo b/security/pdfcrack/distinfo
index 36db0016cf5e..bd26b9bf8782 100644
--- a/security/pdfcrack/distinfo
+++ b/security/pdfcrack/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1510857129
-SHA256 (pdfcrack-0.16.tar.gz) = 7865b203074ccfd5c612c8ce00c46ffcb4fabaa26154ce9304dfc668c7cb73ef
-SIZE (pdfcrack-0.16.tar.gz) = 34467
+TIMESTAMP = 1705079287
+SHA256 (pdfcrack-0.20.tar.gz) = 7b8b29b18fcd5cb984aeb640ee06edf09fede4709b59c32fee4f2d86860de5b4
+SIZE (pdfcrack-0.20.tar.gz) = 35647
diff --git a/security/pdfcrack/files/patch-md5 b/security/pdfcrack/files/patch-md5
new file mode 100644
index 000000000000..1857662bf6cd
--- /dev/null
+++ b/security/pdfcrack/files/patch-md5
@@ -0,0 +1,88 @@
+--- md5.h 2015-07-25 16:10:57.000000000 -0400
++++ md5.h 2024-01-12 12:57:19.536200000 -0500
+@@ -20,17 +20,18 @@
+ #ifndef _MD5_H_
+ #define _MD5_H_
++#include <sys/types.h>
+ #include <stdint.h>
+
+ void
+-md5(const uint8_t *msg, const unsigned int msgLen, uint8_t *digest);
++md5(const uint8_t *msg, size_t msgLen, uint8_t *digest);
+
+ /** init function for md5_50 which chooses a md5_50 optimised for msgLen,
+ if one is available */
+ void
+-md5_50_init(const unsigned int msgLen);
++md5_50_init(size_t msgLen);
+
+ /** md5_50 is basically for(i=0; i<50; i++) { md5(msg, msgLen, msg); } */
+ void
+-md5_50(uint8_t *msg, const unsigned int msgLen);
++md5_50(uint8_t *msg, size_t msgLen);
+
+ #endif /** _MD5_H_ */
+--- md5.c 2022-10-31 09:55:15.000000000 -0400
++++ md5.c 2024-01-12 12:59:03.846526000 -0500
+@@ -48,20 +48,18 @@
+ #define DD 0x10325476
+
+-static void (*md5_50_variant)();
+-static void md5_50f(uint8_t *msg, const unsigned int msgLen);
+-static void md5_50s(uint8_t *msg, const unsigned int msgLen);
++static void (*md5_50_variant)(uint8_t *, size_t msgLen);
+
+ void
+-md5(const uint8_t *msg, const unsigned int msgLen, uint8_t *digest) {
++md5(const uint8_t *msg, size_t msgLen, uint8_t *digest) {
+ uint32_t x[16];
+ register uint32_t a, b, c, d;
+ uint32_t aa, bb, cc, dd;
+- int n64;
+- int i, j;
+- unsigned int k;
++ size_t n64, i;
++ int j;
++ size_t k;
+
+ /** compute number of 64-byte blocks
+ (length + pad byte (0x80) + 8 bytes for length) */
+- n64 = ((int)msgLen + 72) / 64;
++ n64 = (msgLen + 72) / 64;
+
+ /** initialize a, b, c, d */
+@@ -76,5 +74,5 @@
+
+ /** grab a 64-byte block */
+- for (j = 0; j < 16 && (signed)k < (signed)msgLen - 3; ++j, k += 4)
++ for (j = 0; j < 16 && k + 3 < msgLen; ++j, k += 4)
+ x[j] = ((((((unsigned)msg[k+3] << 8) + (unsigned)msg[k+2]) << 8) + (unsigned)msg[k+1]) << 8) + msg[k];
+ if (i == n64 - 1) {
+@@ -198,5 +196,5 @@
+
+ static void
+-md5_50s(uint8_t *msg, const unsigned int msgLen) {
++md5_50s(uint8_t *msg, size_t msgLen) {
+ int i;
+ for(i=0; i<50; i++) { md5(msg, msgLen, msg); }
+@@ -205,5 +203,5 @@
+ /** fast version of "for(i=0; i<50; i++) { md5(msg, 16, msg); }" */
+ static void
+-md5_50f(uint8_t *msg, const unsigned int msgLen __attribute__((unused))) {
++md5_50f(uint8_t *msg, size_t msgLen __attribute__((unused))) {
+ register uint32_t a, b, c, d;
+ int i;
+@@ -323,5 +321,5 @@
+
+ void
+-md5_50_init(const unsigned int msgLen) {
++md5_50_init(size_t msgLen) {
+ if(msgLen == 16)
+ md5_50_variant = &md5_50f;
+@@ -331,5 +329,5 @@
+
+ void
+-md5_50(uint8_t *msg, const unsigned int msgLen) {
++md5_50(uint8_t *msg, size_t msgLen) {
+ md5_50_variant(msg, msgLen);
+ }