Skip to content

Commit

Permalink
security/ncrypt: fix build with -fno-common
Browse files Browse the repository at this point in the history
Move definition of ROUNDS from header to source file.
This fixes the port on FreeBSD 13 and later.
  • Loading branch information
clausecker committed Apr 11, 2023
1 parent 59c2682 commit 47f2932
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
4 changes: 1 addition & 3 deletions security/ncrypt/Makefile
@@ -1,5 +1,6 @@
PORTNAME= ncrypt
PORTVERSION= 0.8.1
PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-${PORTVERSION:R}/${PORTNAME}-${PORTVERSION:R}.0

Expand All @@ -10,9 +11,6 @@ WWW= http://ncrypt.sourceforge.net/
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING

BROKEN_FreeBSD_13= ld: error: duplicate symbol: ROUNDS
BROKEN_FreeBSD_14= ld: error: duplicate symbol: ROUNDS

USES= tar:tgz
GNU_CONFIGURE= yes

Expand Down
11 changes: 11 additions & 0 deletions security/ncrypt/files/patch-rijndael-alg-fst.c
@@ -0,0 +1,11 @@
--- rijndael-alg-fst.c.orig 2023-04-11 00:20:28 UTC
+++ rijndael-alg-fst.c
@@ -9,6 +9,8 @@

#include "rijndael-alg-fst.h"

+int ROUNDS;
+
#define SC ((BC - 4) >> 1)

#include "boxes-fst.dat"
11 changes: 11 additions & 0 deletions security/ncrypt/files/patch-rijndael-alg-fst.h
@@ -0,0 +1,11 @@
--- rijndael-alg-fst.h.orig 2023-04-11 00:20:14 UTC
+++ rijndael-alg-fst.h
@@ -11,7 +11,7 @@ typedef unsigned char word8;
typedef unsigned short word16;
typedef unsigned int word32;

-int ROUNDS;
+extern int ROUNDS;

int rijndaelKeySched (word8 k[MAXKC][4], int keyBits,
word8 rk[MAXROUNDS+1][4][4]);

0 comments on commit 47f2932

Please sign in to comment.