From 17dbe40be19aac07dc9b8a19a37e6b123d656a59 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 22 Jun 2018 15:37:48 -0700 Subject: [PATCH] Restore definitions lost in the merge. Include blowfish-test.scm but do not use it. It needs define-test. --- src/blowfish/Makefile.am | 2 +- src/blowfish/blowfish-check.scm | 46 +++++++++++++++++++++++++++++++++ src/blowfish/blowfish-check.sh | 2 +- src/blowfish/blowfish.pkg | 8 +++++- src/blowfish/blowfish.scm | 17 ++++++++++++ src/edwin/decls.scm | 3 ++- src/edwin/sources.sh | 2 +- src/x11-screen/x11-screen.pkg | 4 ++- src/x11/x11.pkg | 9 ++++--- 9 files changed, 83 insertions(+), 10 deletions(-) create mode 100644 src/blowfish/blowfish-check.scm diff --git a/src/blowfish/Makefile.am b/src/blowfish/Makefile.am index 693f920a2..4b998498a 100644 --- a/src/blowfish/Makefile.am +++ b/src/blowfish/Makefile.am @@ -92,7 +92,7 @@ ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) TAGS_DEPENDENCIES = $(all_sources) $(cdecls) EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm blowfish.pkg -EXTRA_DIST += blowfish-test.scm blowfish-check.sh +EXTRA_DIST += blowfish-test.scm blowfish-check.scm blowfish-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian install-data-hook: diff --git a/src/blowfish/blowfish-check.scm b/src/blowfish/blowfish-check.scm new file mode 100644 index 000000000..4737722d4 --- /dev/null +++ b/src/blowfish/blowfish-check.scm @@ -0,0 +1,46 @@ +#| -*-Scheme-*- + +Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, + 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, + 2017, 2018 Massachusetts Institute of Technology + +This file is part of MIT/GNU Scheme. + +MIT/GNU Scheme is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or (at +your option) any later version. + +MIT/GNU Scheme is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with MIT/GNU Scheme; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, +USA. + +|# + +;;;; Test the BLOWFISH option. + +(let ((sample (string->utf8 "Some text to encrypt and decrypt."))) + (call-with-binary-output-file "test" + (lambda (output) + (blowfish-encrypt-port (open-input-bytevector sample) + output + (string->utf8 "secret") + (write-blowfish-file-header output) + #t))) + (let ((read-back + (call-with-binary-input-file "test" + (lambda (input) + (call-with-output-bytevector + (lambda (output) + (blowfish-encrypt-port input output (string->utf8 "secret") + (read-blowfish-file-header input) + #f))))))) + (if (not (bytevector=? sample read-back)) + (error "sample did not decrypt correctly")))) \ No newline at end of file diff --git a/src/blowfish/blowfish-check.sh b/src/blowfish/blowfish-check.sh index 9d40981ce..edf275a27 100755 --- a/src/blowfish/blowfish-check.sh +++ b/src/blowfish/blowfish-check.sh @@ -5,5 +5,5 @@ set -e ${MIT_SCHEME_EXE} --prepend-library . <<\EOF (load-option 'BLOWFISH) -(load "blowfish-test" (->environment '(blowfish))) +(load "blowfish-check" (->environment '(blowfish))) EOF diff --git a/src/blowfish/blowfish.pkg b/src/blowfish/blowfish.pkg index c20420233..23879068a 100644 --- a/src/blowfish/blowfish.pkg +++ b/src/blowfish/blowfish.pkg @@ -30,6 +30,8 @@ USA. (files "blowfish") (parent ()) (export () + import-blowfish) + (export (blowfish global) blowfish-cbc blowfish-cfb64 blowfish-ecb @@ -39,4 +41,8 @@ USA. blowfish-set-key compute-blowfish-init-vector read-blowfish-file-header - write-blowfish-file-header)) \ No newline at end of file + write-blowfish-file-header)) + +(define-package (blowfish global) + ;; Just to get cref to analyze whether all exports are defined. + ) \ No newline at end of file diff --git a/src/blowfish/blowfish.scm b/src/blowfish/blowfish.scm index 74480fe8a..55dcc3b4a 100644 --- a/src/blowfish/blowfish.scm +++ b/src/blowfish/blowfish.scm @@ -29,6 +29,23 @@ USA. (declare (usual-integrations)) +(define (import-blowfish) + (let ((target-environment (nearest-repl/environment)) + (source-environment (->environment '(blowfish)))) + (for-each (lambda (name) + (link-variables target-environment name + source-environment name)) + '(blowfish-cbc + blowfish-cfb64 + blowfish-ecb + blowfish-encrypt-port + blowfish-file? + blowfish-ofb64 + blowfish-set-key + compute-blowfish-init-vector + read-blowfish-file-header + write-blowfish-file-header)))) + (C-include "blowfish") (define (blowfish-set-key bytes) diff --git a/src/edwin/decls.scm b/src/edwin/decls.scm index 2b5e72594..6f9183c60 100644 --- a/src/edwin/decls.scm +++ b/src/edwin/decls.scm @@ -97,7 +97,8 @@ USA. "termcap" "utils" "win32" - "xform")) + "xform" + "xterm")) (sf-edwin "tterm" "termcap") (let ((includes '("struct" "comman" "modes" "buffer" "edtstr"))) (let loop ((files includes) (includes '())) diff --git a/src/edwin/sources.sh b/src/edwin/sources.sh index 1c04f1805..20f982b6a 100755 --- a/src/edwin/sources.sh +++ b/src/edwin/sources.sh @@ -54,7 +54,7 @@ ${MIT_SCHEME_EXE} --batch-mode -- $1 <<\EOF "txtprp" "undo" "unix" "utils" "utlwin" "vc" "vc-bzr" "vc-cvs" "vc-git" "vc-rcs" "vc-svn" "verilog" "vhdl" "webster" "win32" "win32com" "wincom" "window" "winout" "world-monitor" - "xform")) + "xform" "xterm")) (define (my-write . strings) (for-each write-string strings)) diff --git a/src/x11-screen/x11-screen.pkg b/src/x11-screen/x11-screen.pkg index 2a5e2188b..672312a03 100644 --- a/src/x11-screen/x11-screen.pkg +++ b/src/x11-screen/x11-screen.pkg @@ -129,7 +129,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define-package (edwin x11-keys) (files "x11-key") - (parent (edwin))) + (parent (edwin)) + (export (edwin screen x11-screen) + x-make-special-key)) (define-package (edwin x11-commands) (files "x11-command") diff --git a/src/x11/x11.pkg b/src/x11/x11.pkg index 2b7008e6e..1c6055951 100644 --- a/src/x11/x11.pkg +++ b/src/x11/x11.pkg @@ -29,7 +29,9 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define-package (x11) (files "x11") - (parent ())) + (parent ()) + (export () + import-x11)) (define-package (x11 base) (files "x11-base") @@ -38,12 +40,11 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. cp1-ref ustring-cp-size ustring?) - (export () - x-close-all-displays) (export (x11) ->cstring x-visual-deallocate x-close-display + x-close-all-displays x-window-set-input-hint x-window-set-name x-window-set-icon-name @@ -180,7 +181,7 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (define-package (x11 device) (files "x11-device") (parent (x11)) - (export () + (export (x11) create-x-colormap create-x-image x-character-bounds/ascent -- 2.25.1