guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: Add libtomcrypt.


From: guix-commits
Subject: branch master updated: gnu: Add libtomcrypt.
Date: Thu, 11 Feb 2021 04:34:14 -0500

This is an automated email from the git hooks/post-receive script.

efraim pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 4b62be5  gnu: Add libtomcrypt.
4b62be5 is described below

commit 4b62be5ca4b7b406cc8d00c6624d4a64b7192d7a
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Thu Feb 11 11:03:17 2021 +0200

    gnu: Add libtomcrypt.
    
    * gnu/packages/multiprecision.scm (libtomcrypt): New variable.
---
 gnu/packages/multiprecision.scm | 74 ++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 73 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index b3a5ec5..21605c4 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -320,6 +320,78 @@ ISO C.  It is a port of LibTomMath with optional support 
for inline assembler
 multiplies.")
     (license public-domain)))
 
+(define-public libtomcrypt
+  (package
+    (name "libtomcrypt")
+    (version "1.18.2")
+    (outputs '("out" "static"))
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://github.com/libtom/libtomcrypt";
+                            "/releases/download/v" version
+                            "/crypt-" version ".tar.xz"))
+        (sha256
+         (base32
+          "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn"))
+        (modules '((guix build utils)))
+        (snippet
+         '(begin
+            ;; Patch CVE-2019-17362
+            ;; 
https://github.com/libtom/libtomcrypt/commit/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94
+            (substitute* "src/pk/asn1/der/utf8/der_decode_utf8_string.c"
+              (("z > 4") "z == 1 || z > 4"))
+            #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure) ; no configure
+         (add-after 'unpack 'prepare-build
+           (lambda _
+             ;; We want the shared library by default so force it to be the
+             ;; default makefile target.
+             (delete-file "makefile")
+             (symlink "makefile.shared" "makefile")
+             #t))
+         (add-after 'build 'build-static
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "-f" "makefile.unix" make-flags)))
+         (replace 'check
+           (lambda* (#:key test-target make-flags #:allow-other-keys)
+             (apply invoke "make" "-f" "makefile.unix" test-target make-flags)
+             (invoke "./test")))
+         (add-after 'install 'install-static-library
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (static (assoc-ref outputs "static")))
+               (mkdir-p (string-append static "/lib"))
+               (mkdir-p (string-append static "/include"))
+               (rename-file (string-append out "/lib/libtomcrypt.a")
+                            (string-append static "/lib/libtomcrypt.a"))
+               (copy-recursively (string-append out "/include")
+                                 (string-append static "/include"))
+               #t))))
+       #:test-target "test"
+       #:make-flags
+       (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             "CFLAGS += -DLTM_DESC -DUSE_LTM"
+             (string-append "EXTRALIBS=" (assoc-ref %build-inputs "libtommath")
+                            "/lib/libtommath.so")
+             (string-append "CC=" ,(cc-for-target)))))
+    (native-inputs
+     `(("libtool" ,libtool)))
+    (inputs
+     `(("libtommath" ,libtommath)))
+    (home-page "https://www.libtom.net/LibTomCrypt/";)
+    (synopsis "Cryptographic toolkit")
+    (description "LibTomCrypt is a fairly comprehensive, modular and portable
+cryptographic toolkit that provides developers with a vast array of well known
+published block ciphers, one-way hash functions, chaining modes, pseudo-random
+number generators, public key cryptography and a plethora of other routines.")
+    (properties `((lint-hidden-cve . ("CVE-2019-17362"))))
+    (license unlicense)))
+
 (define-public libtommath
   (package
     (name "libtommath")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]