From 32dc809a73102a10e336dc70dfc60dd44d18c323 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 2 Mar 2012 18:30:17 +0100 Subject: game-util/wbfs_file: added ebuild ebuild is based on this version http://files.hboeck.de/wbfs_file-2.9.ebuild added static useflag and dependency on openssl with static-libs if enabled --- games-util/wbfs_file/Manifest | 2 ++ games-util/wbfs_file/wbfs_file-2.9.ebuild | 36 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 games-util/wbfs_file/Manifest create mode 100644 games-util/wbfs_file/wbfs_file-2.9.ebuild (limited to 'games-util/wbfs_file') diff --git a/games-util/wbfs_file/Manifest b/games-util/wbfs_file/Manifest new file mode 100644 index 0000000..48a83e4 --- /dev/null +++ b/games-util/wbfs_file/Manifest @@ -0,0 +1,2 @@ +DIST wbfs_file_2.9.zip 687419 RMD160 50aac97941e27917ac3ada763eb3b30b5924118e SHA1 e7b0c9ffe577cb920d3b43f2e7f0134d5e5556d9 SHA256 2a3973c907dc35398047dbf748863191514f4d2c64423449729c7d36f1b8b838 +EBUILD wbfs_file-2.9.ebuild 686 RMD160 02aba682be46cfd520eeecfd754fe8d44c7d885a SHA1 f3d54319bcab5d6d1d7f08c701efcc412d64dd86 SHA256 08421c0292d356c8428db4a9d2d5b64e16ba9c57b2ffccbd5b2b0d700df6ed58 diff --git a/games-util/wbfs_file/wbfs_file-2.9.ebuild b/games-util/wbfs_file/wbfs_file-2.9.ebuild new file mode 100644 index 0000000..f79d7e3 --- /dev/null +++ b/games-util/wbfs_file/wbfs_file-2.9.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 + +inherit eutils + +DESCRIPTION="wbfs_file binary for working with wbfs files or partitions" +HOMEPAGE="http://cfg-loader.googlecode.com" +LICENSE="GPL-2" +SLOT="0" + +MY_P="${PN}_${PV}" +SRC_URI="http://cfg-loader.googlecode.com/files/${MY_P}.zip" + +KEYWORDS="~amd64" + +IUSE="-static" + +DEPEND="dev-libs/openssl + static? ( dev-libs/openssl[static-libs] )" + +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}/source" + +src_prepare() { + use static || sed -i '/ADD_LF = -static/d' ${S}/Makefile +} + +src_install() { + dobin wbfs_file + dodoc ../readme.txt + dodoc ../readme_orig.txt +} -- cgit v1.2.3 From d30069f48c7ec183ebc60077bdf4fcf887dab0ac Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 6 Mar 2012 22:49:55 +0100 Subject: games-util/wbfs_file: added fix for 64bit --- games-util/wbfs_file/Manifest | 3 ++- games-util/wbfs_file/files/64bit_fix.patch | 38 ++++++++++++++++++++++++++++ games-util/wbfs_file/wbfs_file-2.9-r1.ebuild | 37 +++++++++++++++++++++++++++ games-util/wbfs_file/wbfs_file-2.9.ebuild | 36 -------------------------- 4 files changed, 77 insertions(+), 37 deletions(-) create mode 100644 games-util/wbfs_file/files/64bit_fix.patch create mode 100644 games-util/wbfs_file/wbfs_file-2.9-r1.ebuild delete mode 100644 games-util/wbfs_file/wbfs_file-2.9.ebuild (limited to 'games-util/wbfs_file') diff --git a/games-util/wbfs_file/Manifest b/games-util/wbfs_file/Manifest index 48a83e4..99feb55 100644 --- a/games-util/wbfs_file/Manifest +++ b/games-util/wbfs_file/Manifest @@ -1,2 +1,3 @@ +AUX 64bit_fix.patch 1079 RMD160 90b6221cd765bb229e7b85dd4fab019872111d73 SHA1 5afb50176e10b2704afa4094b321bf6a90a7385c SHA256 e1eeaa04229447eefe44c71decf75a4d88c7423adee4248f06442cb9a9137d1c DIST wbfs_file_2.9.zip 687419 RMD160 50aac97941e27917ac3ada763eb3b30b5924118e SHA1 e7b0c9ffe577cb920d3b43f2e7f0134d5e5556d9 SHA256 2a3973c907dc35398047dbf748863191514f4d2c64423449729c7d36f1b8b838 -EBUILD wbfs_file-2.9.ebuild 686 RMD160 02aba682be46cfd520eeecfd754fe8d44c7d885a SHA1 f3d54319bcab5d6d1d7f08c701efcc412d64dd86 SHA256 08421c0292d356c8428db4a9d2d5b64e16ba9c57b2ffccbd5b2b0d700df6ed58 +EBUILD wbfs_file-2.9-r1.ebuild 723 RMD160 00af920a2e6c377ae3e5d10f0366b1fca56c00fc SHA1 edc4bbfe900104684ca78d4ac45ca723b80a5486 SHA256 718b621be1c7c6f9d7e2eae6f1aa90568b50c75046d30fdddd89a0d3eb6b199d diff --git a/games-util/wbfs_file/files/64bit_fix.patch b/games-util/wbfs_file/files/64bit_fix.patch new file mode 100644 index 0000000..97d6db2 --- /dev/null +++ b/games-util/wbfs_file/files/64bit_fix.patch @@ -0,0 +1,38 @@ +diff -r -u source/libwbfs/rijndael.c wbfs_file_2.9/source/libwbfs/rijndael.c +--- source/libwbfs/rijndael.c 2009-03-26 18:37:14.000000000 +0100 ++++ source/libwbfs/rijndael.c 2012-03-06 22:44:07.000000000 +0100 +@@ -11,10 +11,11 @@ + + #include + #include ++#include + + #define u8 unsigned char /* 8 bits */ +-#define u32 unsigned long /* 32 bits */ +-#define u64 unsigned long long ++#define u32 uint32_t /* 32 bits */ ++#define u64 uint64_t + + /* rotates x one bit to the left */ + +diff -r -u source/tools.h wbfs_file_2.9_64bit//source/tools.h +--- source/tools.h 2009-03-18 17:17:38.000000000 +0100 ++++ source/tools.h 2012-03-06 22:43:26.000000000 +0100 +@@ -5,11 +5,13 @@ + #ifndef _TOOLS_H + #define _TOOLS_H + ++#include ++ + // basic data types + typedef unsigned char u8; +-typedef unsigned short u16; +-typedef unsigned int u32; +-typedef unsigned long long u64; ++typedef uint16_t u16; ++typedef uint32_t u32; ++typedef uint64_t u64; + + u16 be16(const u8 *p); + u32 be32(const u8 *p); +Only in wbfs_file_2.9_64bit//source: wbfs_file diff --git a/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild b/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild new file mode 100644 index 0000000..158cd24 --- /dev/null +++ b/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild @@ -0,0 +1,37 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 + +inherit eutils + +DESCRIPTION="wbfs_file binary for working with wbfs files or partitions" +HOMEPAGE="http://cfg-loader.googlecode.com" +LICENSE="GPL-2" +SLOT="0" + +MY_P="${PN}_${PV}" +SRC_URI="http://cfg-loader.googlecode.com/files/${MY_P}.zip" + +KEYWORDS="~amd64" + +IUSE="-static" + +DEPEND="dev-libs/openssl + static? ( dev-libs/openssl[static-libs] )" + +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}/source" + +src_prepare() { + use static || sed -i '/ADD_LF = -static/d' ${S}/Makefile + epatch "${FILESDIR}/64bit_fix.patch" +} + +src_install() { + dobin wbfs_file + dodoc ../readme.txt + dodoc ../readme_orig.txt +} diff --git a/games-util/wbfs_file/wbfs_file-2.9.ebuild b/games-util/wbfs_file/wbfs_file-2.9.ebuild deleted file mode 100644 index f79d7e3..0000000 --- a/games-util/wbfs_file/wbfs_file-2.9.ebuild +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI=2 - -inherit eutils - -DESCRIPTION="wbfs_file binary for working with wbfs files or partitions" -HOMEPAGE="http://cfg-loader.googlecode.com" -LICENSE="GPL-2" -SLOT="0" - -MY_P="${PN}_${PV}" -SRC_URI="http://cfg-loader.googlecode.com/files/${MY_P}.zip" - -KEYWORDS="~amd64" - -IUSE="-static" - -DEPEND="dev-libs/openssl - static? ( dev-libs/openssl[static-libs] )" - -RDEPEND="${DEPEND}" - -S="${WORKDIR}/${MY_P}/source" - -src_prepare() { - use static || sed -i '/ADD_LF = -static/d' ${S}/Makefile -} - -src_install() { - dobin wbfs_file - dodoc ../readme.txt - dodoc ../readme_orig.txt -} -- cgit v1.2.3 From 2d101f80f8a893c6fce63bf1cb5225219e9d82c1 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 6 Mar 2012 23:21:19 +0100 Subject: games-util/wbfs_file: added patch to remove openssl deps --- games-util/wbfs_file/Manifest | 3 +- games-util/wbfs_file/files/no-openssl.patch | 169 +++++++++++++++++++++++++++ games-util/wbfs_file/wbfs_file-2.9-r1.ebuild | 37 ------ games-util/wbfs_file/wbfs_file-2.9-r2.ebuild | 38 ++++++ 4 files changed, 209 insertions(+), 38 deletions(-) create mode 100644 games-util/wbfs_file/files/no-openssl.patch delete mode 100644 games-util/wbfs_file/wbfs_file-2.9-r1.ebuild create mode 100644 games-util/wbfs_file/wbfs_file-2.9-r2.ebuild (limited to 'games-util/wbfs_file') diff --git a/games-util/wbfs_file/Manifest b/games-util/wbfs_file/Manifest index 99feb55..7146d08 100644 --- a/games-util/wbfs_file/Manifest +++ b/games-util/wbfs_file/Manifest @@ -1,3 +1,4 @@ AUX 64bit_fix.patch 1079 RMD160 90b6221cd765bb229e7b85dd4fab019872111d73 SHA1 5afb50176e10b2704afa4094b321bf6a90a7385c SHA256 e1eeaa04229447eefe44c71decf75a4d88c7423adee4248f06442cb9a9137d1c +AUX no-openssl.patch 4011 RMD160 0c26944e6f19374dbd6f6e4412402d982f8aa704 SHA1 548163964592b2d21a944e658dd41aa419619f92 SHA256 48a1d37c8598633fe5b93538fe72aeeeee00a430c7ab0dbd8c70f70d998d9983 DIST wbfs_file_2.9.zip 687419 RMD160 50aac97941e27917ac3ada763eb3b30b5924118e SHA1 e7b0c9ffe577cb920d3b43f2e7f0134d5e5556d9 SHA256 2a3973c907dc35398047dbf748863191514f4d2c64423449729c7d36f1b8b838 -EBUILD wbfs_file-2.9-r1.ebuild 723 RMD160 00af920a2e6c377ae3e5d10f0366b1fca56c00fc SHA1 edc4bbfe900104684ca78d4ac45ca723b80a5486 SHA256 718b621be1c7c6f9d7e2eae6f1aa90568b50c75046d30fdddd89a0d3eb6b199d +EBUILD wbfs_file-2.9-r2.ebuild 758 RMD160 8d00c5a8bc636699b709c1d88d765f1c3b41f15f SHA1 4f57bf0f6bba8ba3b41f06a9940608661035d970 SHA256 8fcfab5f0b625f6211a5579fdebfdfe19680d17a0f9bd109c4ee5c99084c9e6e diff --git a/games-util/wbfs_file/files/no-openssl.patch b/games-util/wbfs_file/files/no-openssl.patch new file mode 100644 index 0000000..cecbb97 --- /dev/null +++ b/games-util/wbfs_file/files/no-openssl.patch @@ -0,0 +1,169 @@ +diff -r -u source/tools.c wbfs_file_2.9_no_openssl//source/tools.c +--- source/tools.c 2010-01-12 13:52:20.000000000 +0100 ++++ wbfs_file_2.9_no_openssl//source/tools.c 2012-03-06 23:14:55.000000000 +0100 +@@ -5,9 +5,6 @@ + #include "tools.h" + + #include // to accommodate certain broken versions of openssl +-#include +-#include +-#include + #include + #include + #include +@@ -61,16 +58,6 @@ + // crypto + // + +-void md5(u8 *data, u32 len, u8 *hash) +-{ +- MD5(data, len, hash); +-} +- +-void sha(u8 *data, u32 len, u8 *hash) +-{ +- SHA1(data, len, hash); +-} +- + void get_key(const char *name, u8 *key, u32 len) + { + char path[256]; +@@ -90,35 +77,6 @@ + fclose(fp); + } + +-void aes_cbc_dec(u8 *key, u8 *iv, u8 *in, u32 len, u8 *out) +-{ +- AES_KEY aes_key; +- +- AES_set_decrypt_key(key, 128, &aes_key); +- AES_cbc_encrypt(in, out, len, &aes_key, iv, AES_DECRYPT); +-} +- +-void aes_cbc_enc(u8 *key, u8 *iv, u8 *in, u32 len, u8 *out) +-{ +- AES_KEY aes_key; +- +- AES_set_encrypt_key(key, 128, &aes_key); +- AES_cbc_encrypt(in, out, len, &aes_key, iv, AES_ENCRYPT); +-} +- +-void decrypt_title_key(u8 *tik, u8 *title_key) +-{ +- u8 common_key[16]; +- u8 iv[16]; +- +- get_key("common-key", common_key, 16); +- +- memset(iv, 0, sizeof iv); +- memcpy(iv, tik + 0x01dc, 8); +- aes_cbc_dec(common_key, iv, tik + 0x01bf, 16, title_key); +- printf("title key: %02x %02x %02x\n",title_key[0],title_key[1],title_key[2]); +-} +- + static u8 root_key[0x204]; + static u8 *get_root_key(void) + { +@@ -166,26 +124,6 @@ + return 0; + } + +-int check_ec(u8 *ng, u8 *ap, u8 *sig, u8 *sig_hash) +-{ +- u8 ap_hash[20]; +- u8 *ng_Q, *ap_R, *ap_S; +- u8 *ap_Q, *sig_R, *sig_S; +- +- ng_Q = ng + 0x0108; +- ap_R = ap + 0x04; +- ap_S = ap + 0x22; +- +- SHA1(ap + 0x80, 0x100, ap_hash); +- +- ap_Q = ap + 0x0108; +- sig_R = sig; +- sig_S = sig + 30; +- +- return check_ecdsa(ng_Q, ap_R, ap_S, ap_hash) +- && check_ecdsa(ap_Q, sig_R, sig_S, sig_hash); +-} +- + static int check_rsa(u8 *h, u8 *sig, u8 *key, u32 n) + { + u8 correct[0x200]; +@@ -268,57 +206,6 @@ + return 0; + } + +-int check_cert_chain(u8 *data, u32 data_len, u8 *cert, u32 cert_len) +-{ +- u8 *sig; +- u8 *sub; +- u32 sig_len; +- u32 sub_len; +- u8 h[20]; +- u8 *key_cert; +- u8 *key; +- int ret; +- sig = data; +- sig_len = get_sig_len(sig); +- if (sig_len == 0) +- return -1; +- sub = data + sig_len; +- sub_len = data_len - sig_len; +- if (sub_len == 0) +- return -2; +- +- for (;;) { +- printf(">>>>>> checking sig by %s...\n", sub); +- if (strcmp((char*)sub, "Root") == 0) { +- key = get_root_key(); +- sha(sub, sub_len, h); +- if (be32(sig) != 0x10000) +- return -8; +- return check_rsa(h, sig + 4, key, 0x200); +- } +- +- key_cert = find_cert_in_chain(sub, cert, cert_len); +- if (key_cert == 0) +- return -3; +- +- key = key_cert + get_sig_len(key_cert); +- +- sha(sub, sub_len, h); +- ret = check_hash(h, sig, key); +- if (ret) +- return ret; +- +- sig = key_cert; +- sig_len = get_sig_len(sig); +- if (sig_len == 0) +- return -4; +- sub = sig + sig_len; +- sub_len = get_sub_len(sub); +- if (sub_len == 0) +- return -5; +- } +-} +- + // + // compression + // +diff -r -u source/tools.h wbfs_file_2.9_no_openssl//source/tools.h +--- source/tools.h 2009-03-18 17:17:38.000000000 +0100 ++++ wbfs_file_2.9_no_openssl//source/tools.h 2012-03-06 23:15:03.000000000 +0100 +@@ -32,14 +32,7 @@ + void bn_exp(u8 *d, u8 *a, u8 *N, u32 n, u8 *e, u32 en); + + // crypto +-void md5(u8 *data, u32 len, u8 *hash); +-void sha(u8 *data, u32 len, u8 *hash); + void get_key(const char *name, u8 *key, u32 len); +-void aes_cbc_dec(u8 *key, u8 *iv, u8 *in, u32 len, u8 *out); +-void aes_cbc_enc(u8 *key, u8 *iv, u8 *in, u32 len, u8 *out); +-void decrypt_title_key(u8 *tik, u8 *title_key); +-int check_cert_chain(u8 *data, u32 data_len, u8 *cert, u32 cert_len); +-int check_ec(u8 *ng, u8 *ap, u8 *sig, u8 *sig_hash); + void generate_ecdsa(u8 *R, u8 *S, u8 *k, u8 *hash); + int check_ecdsa(u8 *Q, u8 *R, u8 *S, u8 *hash); + void ec_priv_to_pub(u8 *k, u8 *Q); diff --git a/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild b/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild deleted file mode 100644 index 158cd24..0000000 --- a/games-util/wbfs_file/wbfs_file-2.9-r1.ebuild +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 1999-2010 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI=2 - -inherit eutils - -DESCRIPTION="wbfs_file binary for working with wbfs files or partitions" -HOMEPAGE="http://cfg-loader.googlecode.com" -LICENSE="GPL-2" -SLOT="0" - -MY_P="${PN}_${PV}" -SRC_URI="http://cfg-loader.googlecode.com/files/${MY_P}.zip" - -KEYWORDS="~amd64" - -IUSE="-static" - -DEPEND="dev-libs/openssl - static? ( dev-libs/openssl[static-libs] )" - -RDEPEND="${DEPEND}" - -S="${WORKDIR}/${MY_P}/source" - -src_prepare() { - use static || sed -i '/ADD_LF = -static/d' ${S}/Makefile - epatch "${FILESDIR}/64bit_fix.patch" -} - -src_install() { - dobin wbfs_file - dodoc ../readme.txt - dodoc ../readme_orig.txt -} diff --git a/games-util/wbfs_file/wbfs_file-2.9-r2.ebuild b/games-util/wbfs_file/wbfs_file-2.9-r2.ebuild new file mode 100644 index 0000000..bc48d39 --- /dev/null +++ b/games-util/wbfs_file/wbfs_file-2.9-r2.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=2 + +inherit eutils + +DESCRIPTION="wbfs_file binary for working with wbfs files or partitions" +HOMEPAGE="http://cfg-loader.googlecode.com" +LICENSE="GPL-2" +SLOT="0" + +MY_P="${PN}_${PV}" +SRC_URI="http://cfg-loader.googlecode.com/files/${MY_P}.zip" + +KEYWORDS="~x86 ~amd64" + +IUSE="-static" + +DEPEND="" +RDEPEND="${DEPEND}" + +S="${WORKDIR}/${MY_P}/source" + +src_prepare() { + use static || sed -i '/ADD_LF = -static/d' ${S}/Makefile + use amd64 && epatch "${FILESDIR}/64bit_fix.patch" + + sed -i 's/-lcrypto//' ${S}/Makefile + epatch "${FILESDIR}/no-openssl.patch" +} + +src_install() { + dobin wbfs_file + dodoc ../readme.txt + dodoc ../readme_orig.txt +} -- cgit v1.2.3