Notification time stamped 2022-02-01 00:04:19 UTC
From 693a46ff40187a2a48ba5bd86339e829e45dcc3b Mon Sep 17 00:00:00 2001
From: Robert Scheck <robert(a)fedoraproject.org>
Date: Jan 06 2016 03:28:07 +0000
Subject: Upgrade to 0.5.1
---
diff --git a/dislocker-0.4.1-off_t.patch b/dislocker-0.4.1-off_t.patch
deleted file mode 100644
index d7469a8..0000000
--- a/dislocker-0.4.1-off_t.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.4.1 which
adds
-a missing include to avoid the build-time error "expected specifier-qualifier-list
-before 'off_t'" on Red Hat Enterprise Linux 5 (and derivates like CentOS).
See also
-https://github.com/Aorimn/dislocker/issues/35 for further details.
-
---- dislocker-0.4.1/src/config.h 2014-11-16 18:35:11.000000000 +0100
-+++ dislocker-0.4.1/src/config.h.off_t 2015-05-30 21:08:24.000000000 +0200
-@@ -25,6 +25,7 @@
-
-
- #include "xstd/xstdio.h"
-+#include <sys/types.h>
-
-
-
diff --git a/dislocker-0.4.1-paths.patch b/dislocker-0.4.1-paths.patch
deleted file mode 100644
index 8b57417..0000000
--- a/dislocker-0.4.1-paths.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.4.1 that
adds
-$RPM_OPT_FLAGS to CFLAGS, $RPM_LD_FLAGS to LDFLAGS as downstream should be able to
-add own build-time flags all the time. Additionally it renames DESTDIR to PREFIX to
-be able to use DESTDIR as it should be used (independent of the path hierarchy). It
-finally changes absolute symlinks to relative symlinks to avoid failures in chroot
-environemnts, see also
https://github.com/Aorimn/dislocker/pull/37 for details.
-
---- dislocker-0.4.1/src/Makefile 2014-11-16 18:35:11.000000000 +0100
-+++ dislocker-0.4.1/src/Makefile.paths 2015-05-30 21:11:57.000000000 +0200
-@@ -22,8 +22,8 @@
- CHARDEN = -fstack-protector -fPIC -D_FORTIFY_SOURCE=2 -O1
- LHARDEN = -pie -fPIE
- WFLAGS = -Wall -Werror -Wextra
--CFLAGS = $(WFLAGS) $(DEFINES) $(INC) $(CHARDEN)
--override LDFLAGS += -l$(PROGNAME) $(LIB) $(LHARDEN)
-+CFLAGS = $(WFLAGS) $(DEFINES) $(INC) $(CHARDEN) $(RPM_OPT_FLAGS)
-+override LDFLAGS += -l$(PROGNAME) $(LIB) $(LHARDEN) $(RPM_LD_FLAGS)
- LINKERNAME := lib$(PROGNAME).so
- SONAME := $(LINKERNAME).$(VERSION_MAJOR)
- LIBNAME := $(LINKERNAME).$(VERSION)
-@@ -51,18 +51,18 @@
-
-
-
--DESTDIR = /usr
-+PREFIX = /usr
-
--BINARIES_PATH = $(DESTDIR)/bin/
--LIBRARY_PATH = $(DESTDIR)/lib/
-+BINARIES_PATH = $(DESTDIR)$(PREFIX)/bin/
-+LIBRARY_PATH = $(DESTDIR)$(PREFIX)/lib/
- # Change library path for OS which have a lib64/ directory as ld's looking into
- # it while loading the library instead of lib/
--ifneq ("$(wildcard $(DESTDIR)/lib64/)", "")
--LIBRARY_PATH = $(DESTDIR)/lib64/
-+ifneq ("$(wildcard $(PREFIX)/lib64/)", "")
-+LIBRARY_PATH = $(DESTDIR)$(PREFIX)/lib64/
- endif
-
- MAN_NUMBER := 1
--MAN_PATH := $(DESTDIR)/share/man/man$(MAN_NUMBER)/
-+MAN_PATH := $(DESTDIR)$(PREFIX)/share/man/man$(MAN_NUMBER)/
- MAN_ROOT := ../man/
- MAN_PAGE := $(BIN)_man
-
-@@ -155,12 +155,13 @@
-
-
- install: all
-+ mkdir -p $(BINARIES_PATH) $(LIBRARY_PATH) $(MAN_PATH)$(BIN)
- install -pm755 $(BINS) $(BINARIES_PATH)
- ln -s $(DEFAULT_PROG) $(BINARIES_PATH)$(BIN)
- install -pm755 $(LIBNAME) $(LIBRARY_PATH)
-- ln -s $(LIBRARY_PATH)$(LIBNAME) $(LIBRARY_PATH)$(SONAME)
-- ln -s $(LIBRARY_PATH)$(SONAME) $(LIBRARY_PATH)$(LINKERNAME)
-- cp $(MAN_ROOT)$(MAN_PAGE) $(MAN_ROOT)$(BIN).$(MAN_NUMBER)
-+ ln -s $(LIBNAME) $(LIBRARY_PATH)$(SONAME)
-+ ln -s $(SONAME) $(LIBRARY_PATH)$(LINKERNAME)
-+ cp -p $(MAN_ROOT)$(MAN_PAGE) $(MAN_ROOT)$(BIN).$(MAN_NUMBER)
- gzip $(MAN_ROOT)$(BIN).$(MAN_NUMBER)
- mv $(MAN_ROOT)$(BIN).$(MAN_NUMBER).gz $(MAN_PATH)
- @echo "==========================================================="
diff --git a/dislocker-0.5.1-assert.patch b/dislocker-0.5.1-assert.patch
new file mode 100644
index 0000000..7cdd2d8
--- /dev/null
+++ b/dislocker-0.5.1-assert.patch
@@ -0,0 +1,86 @@
+Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.5.1 to
replace the C++11 syntax with
+_Static_assert() by something more GCC 4.1.x compatible; see:
https://github.com/Aorimn/dislocker/pull/58
+
+--- dislocker-0.5.1/include/dislocker/metadata/datums.h 2016-01-03 16:55:16.000000000
+0100
++++ dislocker-0.5.1/include/dislocker/metadata/datums.h.assert 2016-01-06
03:43:47.000000000 +0100
+@@ -32,6 +32,11 @@
+ #include "dislocker/ntfs/encoding.h"
+ #include "dislocker/encryption/encommon.h"
+
++#include <assert.h>
++
++#ifndef static_assert
++#define static_assert(x, s) extern int static_assertion[2*!!(x)-1]
++#endif
+
+
+ /**
+@@ -102,7 +107,7 @@
+ uint16_t error_status;
+ } datum_header_safe_t;
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _header_safe) == 8,
+ "Datum header structure's size isn't equal to 8"
+ );
+--- dislocker-0.5.1/include/dislocker/metadata/metadata.priv.h 2016-01-03
16:55:16.000000000 +0100
++++ dislocker-0.5.1/include/dislocker/metadata/metadata.priv.h.assert 2016-01-06
03:44:16.000000000 +0100
+@@ -40,6 +40,12 @@
+ } \
+ } while(0);
+
++#include <assert.h>
++
++#ifndef static_assert
++#define static_assert(x, s) extern int static_assertion[2*!!(x)-1]
++#endif
++
+
+
+ #pragma pack (1)
+@@ -100,7 +106,7 @@
+ uint16_t boot_partition_identifier; // = 0xaa55 --
offset 0x1fe
+ } volume_header_t; // Size = 512
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _volume_header) == 512,
+ "Volume header structure's size isn't equal to 512"
+ );
+@@ -123,7 +129,7 @@
+ ntfs_time_t timestamp; // -- offset 0x28
+ } bitlocker_dataset_t; // Size = 0x30
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _bitlocker_dataset) == 0x30,
+ "BitLocker dataset structure's size isn't equal to 0x30"
+ );
+@@ -176,7 +182,7 @@
+ struct _bitlocker_dataset dataset; // See above
-- offset 0x40
+ } bitlocker_information_t; // Size = 0x40 + 0x30
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _bitlocker_information) == (0x40 + 0x30),
+ "BitLocker information structure's size isn't equal to 0x70"
+ );
+@@ -199,7 +205,7 @@
+ uint32_t crc32;
+ } bitlocker_validations_t; // Size = 8
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _bitlocker_validations) == 8,
+ "BitLocker validations structure's size isn't equal to 8"
+ );
+@@ -227,7 +233,7 @@
+ uint64_t disk_offsets[2]; // -- offset
0x28
+ } bitlocker_eow_infos_t; // Size = 0x38
+
+-_Static_assert(
++static_assert(
+ sizeof(struct _bitlocker_eow_infos) == 0x38,
+ "BitLocker EOW information structure's size isn't equal to 0x38"
+ );
diff --git a/dislocker-0.5.1-destdir.patch b/dislocker-0.5.1-destdir.patch
new file mode 100644
index 0000000..56d97ec
--- /dev/null
+++ b/dislocker-0.5.1-destdir.patch
@@ -0,0 +1,16 @@
+Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.5.1 to fix
destination
+paths of the created symlinks; see:
https://github.com/Aorimn/dislocker/pull/55
+
+--- dislocker-0.5.1/src/CMakeLists.txt 2016-01-03 16:55:16.000000000 +0100
++++ dislocker-0.5.1/src/CMakeLists.txt.destdir 2016-01-06 02:29:14.283515587 +0100
+@@ -229,8 +229,8 @@
+ set (BIN_FIND true)
+ endif()
+
+-install (CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink
${BIN_FUSE} \"${bindir}/${PROJECT_NAME}\")")
+-install (CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink
${BIN_FUSE}.1.gz \"${mandir}/man1/${PROJECT_NAME}.1.gz\")")
++install (CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink
${BIN_FUSE} \"\$ENV{DESTDIR}${bindir}/${PROJECT_NAME}\")")
++install (CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink
${BIN_FUSE}.1.gz \"\$ENV{DESTDIR}${mandir}/man1/${PROJECT_NAME}.1.gz\")")
+
+ set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
"${CLEAN_FILES}")
+
diff --git a/dislocker-0.5.1-limits.patch b/dislocker-0.5.1-limits.patch
new file mode 100644
index 0000000..84db877
--- /dev/null
+++ b/dislocker-0.5.1-limits.patch
@@ -0,0 +1,23 @@
+Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.5.1 to
avoid build-
+error "error: 'UINT_MAX' undeclared"; see:
https://github.com/Aorimn/dislocker/pull/56
+
+--- dislocker-0.5.1/src/metadata/vmk.c 2016-01-03 16:55:16.000000000 +0100
++++ dislocker-0.5.1/src/metadata/vmk.c.limits 2016-01-06 02:20:13.517191777 +0100
+@@ -22,6 +22,7 @@
+ */
+
+
++#include <limits.h>
+ #include "dislocker/encryption/decrypt.h"
+ #include "dislocker/metadata/vmk.h"
+
+--- dislocker-0.5.1/src/metadata/fvek.c 2016-01-03 16:55:16.000000000 +0100
++++ dislocker-0.5.1/src/metadata/fvek.c.limits 2016-01-06 02:21:33.535499812 +0100
+@@ -21,6 +21,7 @@
+ * USA.
+ */
+
++#include <limits.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
diff --git a/dislocker-0.5.1-off_t.patch b/dislocker-0.5.1-off_t.patch
new file mode 100644
index 0000000..f678ff3
--- /dev/null
+++ b/dislocker-0.5.1-off_t.patch
@@ -0,0 +1,23 @@
+Patch by Robert Scheck <robert(a)fedoraproject.org> for dislocker >= 0.5.1 to
avoid build-time error "error:
+expected declaration specifiers or '...' before 'off_t'"; see:
https://github.com/Aorimn/dislocker/pull/57
+
+--- dislocker-0.5.1/include/dislocker/encryption/decrypt.h 2016-01-03 16:55:16.000000000
+0100
++++ dislocker-0.5.1/include/dislocker/encryption/decrypt.h.off_t 2016-01-06
03:16:56.000000000 +0100
+@@ -27,6 +27,7 @@
+ #define AUTHENTICATOR_LENGTH 16
+
+
++#include <sys/types.h>
+ #include "dislocker/xstd/xstdio.h" // Only for off_t
+ #include "dislocker/encryption/encommon.h"
+
+--- dislocker-0.5.1/include/dislocker/dislocker.h 2016-01-03 16:55:16.000000000 +0100
++++ dislocker-0.5.1/include/dislocker/dislocker.h.off_t 2016-01-06 03:25:27.843909780
+0100
+@@ -24,6 +24,7 @@
+ #define DISLOCKER_MAIN_H
+
+ #include <stdint.h>
++#include <sys/types.h>
+ #include "dislocker/xstd/xstdio.h" // Only for off_t
+
+
diff --git a/dislocker.spec b/dislocker.spec
index dbb358d..c510953 100644
--- a/dislocker.spec
+++ b/dislocker.spec
@@ -1,18 +1,20 @@
Summary: Utility to access BitLocker encrypted volumes
Name: dislocker
-Version: 0.4.1
-Release: 5%{?dist}
+Version: 0.5.1
+Release: 1%{?dist}
License: GPLv2+
Group: Applications/System
URL:
https://github.com/Aorimn/dislocker
Source0:
https://github.com/Aorimn/dislocker/archive/v%{version}.tar.gz
-Patch0: dislocker-0.4.1-paths.patch
-Patch1: dislocker-0.4.1-off_t.patch
+Patch0: dislocker-0.5.1-limits.patch
+Patch1: dislocker-0.5.1-destdir.patch
+Patch2: dislocker-0.5.1-assert.patch
+Patch3: dislocker-0.5.1-off_t.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
Requires(post): %{_sbindir}/update-alternatives
Requires(preun): %{_sbindir}/update-alternatives
Provides: %{_bindir}/%{name}
-BuildRequires: mbedtls-devel
+BuildRequires: cmake, mbedtls-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
@@ -61,46 +63,29 @@ reading from it or writing to it is possible.
%prep
%setup -q
-%patch0 -p1 -b .paths
-%patch1 -p1 -b .off_t
+%patch0 -p1 -b .limits
+%patch1 -p1 -b .destdir
+%patch2 -p1 -b .assert
+%patch3 -p1 -b .off_t
%build
-# PolarSSL was acquired by ARM in November 2014 and renamed to mbed TLS
-sed -e 's/-lpolarssl/-lmbedtls/g' -i src/Makefile
src/accesses/user_pass/Makefile
-sed -e 's/polarssl/mbedtls/g' -i
src/{accesses/stretch_key,encommon,ssl_bindings}.h
-sed -e 's/aes_context/mbedtls_aes_context/g' -i src/ssl_bindings.h
-sed -e 's/sha2\.h/sha256\.h/g' -i src/accesses/stretch_key.h
-sed -e 's/AES_ENCRYPT/MBEDTLS_AES_ENCRYPT/g' -i
src/encryption/{decrypt,encrypt}.c
-sed -e 's/AES_DECRYPT/MBEDTLS_AES_DECRYPT/g' -i
src/encryption/{decrypt,encrypt}.c
-sed -e 's/aes_setkey_enc/mbedtls_aes_setkey_enc/g' -i src/ssl_bindings.h
-sed -e 's/aes_crypt_ecb/mbedtls_aes_crypt_ecb/g' -i src/ssl_bindings.h
-sed -e 's/aes_crypt_cbc/mbedtls_aes_crypt_cbc/g' -i src/ssl_bindings.h
-sed -e 's/aes_setkey_dec/mbedtls_aes_setkey_dec/g' -i src/ssl_bindings.h
-sed -e 's/sha2(/mbedtls_sha256(/' -i src/ssl_bindings.h
-
-cd src
-make %{?_smp_mflags} RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wno-error"
-cd ..
-
-# Clean up files for later usage in documentation
-for file in *.txt; do mv -f $file ${file%.txt}; done
+%cmake -D WARN_FLAGS="-Wall -Wno-error -Wextra" .
+make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
-
-cd src
make DESTDIR=$RPM_BUILD_ROOT install
-cd ..
-
-# Install a copy of the man page for FUSE package
-install -p -m 644 man/dislocker_man $RPM_BUILD_ROOT%{_mandir}/man1/%{name}-fuse.1
-# Remove standard symlink due to alternatives
-rm -f $RPM_BUILD_ROOT%{_bindir}/%{name}
+# Remove standard symlinks due to alternatives
+rm -f $RPM_BUILD_ROOT{%{_bindir}/%{name},%{_mandir}/man1/%{name}.1*}
# Remove symlink, because of missing -devel package
rm -f $RPM_BUILD_ROOT%{_libdir}/libdislocker.so
+# Clean up files for later usage in documentation
+for file in *.md; do mv -f $file ${file%.md}; done
+for file in *.txt; do mv -f $file ${file%.txt}; done
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -129,11 +114,13 @@ fi
%{_bindir}/%{name}-bek
%{_bindir}/%{name}-file
%{_bindir}/%{name}-metadata
-%{_mandir}/man1/%{name}.1*
+%{_mandir}/man1/%{name}-file.1*
%files libs
%defattr(-,root,root,-)
-%doc CHANGELOG LICENSE README
+%{!?_licensedir:%global license %%doc}
+%license LICENSE
+%doc CHANGELOG README
%{_libdir}/libdislocker.so.*
%files -n fuse-dislocker
@@ -142,6 +129,9 @@ fi
%{_mandir}/man1/%{name}-fuse.1*
%changelog
+* Wed Jan 06 2016 Robert Scheck <robert(a)fedoraproject.org> 0.5.1-1
+- Upgrade to 0.5.1
+
* Sat Jul 25 2015 Robert Scheck <robert(a)fedoraproject.org> 0.4.1-5
- Rebuilt for mbed TLS 2.0.0
diff --git a/sources b/sources
index 0e49cd0..d3419fb 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f8983383a65ca7e82cf246d978dc2c3f v0.4.1.tar.gz
+7288a141ba0ce6232d8e6a6a1e337393 v0.5.1.tar.gz
https://src.fedoraproject.org/rpms/dislocker/c/693a46ff40187a2a48ba5bd863...