~ubuntu-branches/ubuntu/lucid/cryptsetup/lucid

« back to all changes in this revision

Viewing changes to luks/Makefile.in

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2006-11-19 20:04:19 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061119200419-x5926mwvvrjbfqr0
Tags: 2:1.0.4-8ubuntu1
* merge debian changes, remaining patches:
  - Always output and read from the console.  Ubuntu: #58794.
* other changes have been merged or do noy apply anymore
* read password via usplash if available in initramfs for rootfs. based on a patch from  
  Swen Thümmler (Thanks for that!)  Ubuntu #62751
* read password from initscript via usplash if running. should fix the
  rest of Ubuntu #62751. Only problem with that patch: It asks only once
  for the password! improvements welcome!

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
subdir = luks
41
41
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
42
42
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
43
 
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 
43
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
 
44
        $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/lib-ld.m4 \
 
45
        $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
 
46
        $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
 
47
        $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/acinclude.m4 \
44
48
        $(top_srcdir)/configure.in
45
49
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
46
50
        $(ACLOCAL_M4)
236
240
EXTRA_DIST = sha/hmac.c testing/fileDiffer.py
237
241
ORIG_IMG = /tmp/luks-test-orig
238
242
IMG = /tmp/luks-test
 
243
IMG1 = /tmp/luks-test1
239
244
LUKS_HEADER = S0-5 S6-7 S8-39 S40-71 S72-103 S104-107 S108-111 R112-131 R132-163 S164-167 S168-207 A0-591
240
245
KEY_SLOT0 = S208-211 S212-215 R216-247 S248-251 S251-255
241
246
KEY_MATERIAL0 = R4096-68096
706
711
        @if [ ! -e /tmp/key1 ]; then    \
707
712
                dd if=/dev/urandom of=/tmp/key1 count=1 bs=32; \
708
713
        fi
709
 
        @dd if=/dev/zero of=$(IMG) count=20000
 
714
        @bzip2 -cd testing/compatimage.bz2 > $(IMG)
710
715
        @-/sbin/losetup -d $(LOOPDEV)
711
716
        @/sbin/losetup $(LOOPDEV) $(IMG)
712
717
 
713
 
# Format Test
 
718
        @echo Case: open - compat image - acceptance check
 
719
# Image must not change
 
720
        @cp $(IMG) $(ORIG_IMG)
 
721
        echo "compatkey" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy
 
722
        @sync
 
723
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) 
 
724
        @-ls -l /dev/mapper/dummy > /dev/null
 
725
        @../src/cryptsetup remove dummy
 
726
        @echo "success"
 
727
 
 
728
        @echo Case: open - compat image - denial check
 
729
# Image must not change
 
730
        @cp $(IMG) $(ORIG_IMG)
 
731
        echo "wrongkey" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy || true
 
732
        @sync
 
733
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) 
 
734
        @echo "success"
 
735
 
 
736
        @echo Case: format
714
737
# All headers items and first key material section must change
715
738
        @cp $(IMG) $(ORIG_IMG)
716
 
        echo "kuh" | ../src/cryptsetup -v -i 1000 -c aes-cbc-essiv:sha256 luksFormat $(LOOPDEV)
 
739
        echo "key0" | ../src/cryptsetup -v -i 1000 -c aes-cbc-essiv:sha256 luksFormat $(LOOPDEV)
717
740
        @sync
718
741
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(LUKS_HEADER) $(KEY_SLOT0) $(KEY_MATERIAL0)
719
742
 
720
 
# Open Test
 
743
        @echo Case: open 
721
744
# Image must not change
722
745
        @cp $(IMG) $(ORIG_IMG)
723
 
        echo "kuh" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy
 
746
        echo "key0" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy
724
747
        @sync
725
748
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) 
726
 
        @-ls -l /dev/mapper/dummy > /dev/null && echo "success (1 of 5)"
 
749
        @-ls -l /dev/mapper/dummy > /dev/null
727
750
        @../src/cryptsetup remove dummy
 
751
        @echo "success"
728
752
 
729
 
# Add Key Test
 
753
        @echo Case: add key
730
754
# Key Slot 1 and key material section 1 must change, the rest must not.
731
755
        @cp $(IMG) $(ORIG_IMG)
732
 
        @echo -e "kuh\nlala\n" | ../src/cryptsetup -v luksAddKey $(LOOPDEV)
 
756
        echo -e "key0\nkey1" | ../src/cryptsetup -v luksAddKey $(LOOPDEV)
733
757
        @sync
734
758
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(KEY_SLOT1) $(KEY_MATERIAL1)
735
 
        @echo "lala" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy
736
 
        @-ls -l /dev/mapper/dummy > /dev/null && echo "success (2 of 5)"
 
759
        echo "key1" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy
 
760
        @-ls -l /dev/mapper/dummy > /dev/null
737
761
        @../src/cryptsetup -v remove dummy
 
762
        @echo "success"
 
763
 
 
764
# Unsuccessful Key Delete - nothing may change
 
765
        @echo Case: unsuccessful delete
 
766
        @cp $(IMG) $(ORIG_IMG)
 
767
        echo "invalid" | ../src/cryptsetup -v luksDelKey $(LOOPDEV) 1 || true
 
768
        @sync
 
769
        testing/fileDiffer.py $(IMG) $(ORIG_IMG)
 
770
        @echo "success"
738
771
 
739
772
# Delete Key Test
740
773
# Key Slot 1 and key material section 1 must change, the rest must not
 
774
        @echo Case: successful delete
741
775
        @cp $(IMG) $(ORIG_IMG)
742
 
        @../src/cryptsetup -v luksDelKey $(LOOPDEV) 1
 
776
        ../src/cryptsetup -v -q luksDelKey $(LOOPDEV) 1
743
777
        @sync
744
778
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(KEY_SLOT1) $(KEY_MATERIAL1_EXT)
745
 
        @echo "lala" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy 2>/dev/null || echo "success (3 of 4)"
 
779
        echo "key1" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy 2>/dev/null || true
 
780
        echo "key0" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy 2>/dev/null 
 
781
        @../src/cryptsetup -v remove dummy
 
782
        @echo "success"
746
783
 
747
 
# Add Key Test for Key Files
748
784
# Key Slot 1 and key material section 1 must change, the rest must not
 
785
        @echo Case: add key test for key files
749
786
        @cp $(IMG) $(ORIG_IMG)
750
 
        @echo -e "kuh\n" | ../src/cryptsetup -v luksAddKey $(LOOPDEV) /tmp/key1
 
787
        echo "key0" | ../src/cryptsetup -v luksAddKey $(LOOPDEV) /tmp/key1
751
788
        @sync
752
789
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(KEY_SLOT1) $(KEY_MATERIAL1)
753
 
        @../src/cryptsetup -d /tmp/key1 -v luksOpen $(LOOPDEV) dummy
754
 
        @-ls -l /dev/mapper/dummy > /dev/null && echo "success (4 of 5)"
755
 
        @../src/cryptsetup -v remove dummy
 
790
        ../src/cryptsetup -d /tmp/key1 -v luksOpen $(LOOPDEV) dummy
 
791
        @-ls -l /dev/mapper/dummy > /dev/null
 
792
        @../src/cryptsetup -v remove dummy
 
793
        @echo "success"
 
794
 
 
795
        @echo Case: delete key test with /tmp/key1 as remaining key
 
796
# Key Slot 1 and key material section 1 must change, the rest must not
 
797
        @cp $(IMG) $(ORIG_IMG)
 
798
        ../src/cryptsetup -v -d /tmp/key1 luksDelKey $(LOOPDEV) 0
 
799
        @sync
 
800
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(KEY_SLOT0) $(KEY_MATERIAL0_EXT)
 
801
        echo "key0" | ../src/cryptsetup -v luksOpen $(LOOPDEV) dummy 2>/dev/null || true
 
802
        ../src/cryptsetup -v luksOpen -d /tmp/key1 $(LOOPDEV) dummy 2>/dev/null
 
803
        @../src/cryptsetup -v remove dummy
 
804
        @echo "success"
756
805
 
757
806
# Format test for ESSIV, and some other parameters. 
 
807
        @echo Case: parameter variation test
758
808
        @dd if=/dev/zero of=$(IMG) count=20000
759
809
        @cp $(IMG) $(ORIG_IMG)
760
810
        @../src/cryptsetup -q -v -i 1000 -c aes-cbc-essiv:sha256 luksFormat $(LOOPDEV) /tmp/key1
761
811
        @sync
762
812
        testing/fileDiffer.py $(IMG) $(ORIG_IMG) $(LUKS_HEADER) $(KEY_SLOT0) $(KEY_MATERIAL0)
763
813
        @../src/cryptsetup -d /tmp/key1 -v luksOpen $(LOOPDEV) dummy
764
 
        @-ls -l /dev/mapper/dummy > /dev/null && echo "success (5 of 5)"
 
814
        @-ls -l /dev/mapper/dummy > /dev/null && echo "success"
765
815
        @../src/cryptsetup -v remove dummy
766
816
# Tell versions [3.59,3.63) of GNU make to not export all variables.
767
817
# Otherwise a system limit (for SysV at least) may be exceeded.