Merge remote-tracking branch 'origin/staging' into darwin-clang-stdenv
Conflicts: pkgs/tools/security/gnupg/default.nix
This commit is contained in:
@@ -1,17 +1,10 @@
|
||||
# Remember to install Pinentry and
|
||||
# 'echo "pinentry-program `which pinentry-gtk-2`" >> ~/.gnupg/gpg-agent.conf'.
|
||||
|
||||
{ fetchurl, stdenv, readline, zlib, libgpgerror, pth, libgcrypt, libassuan
|
||||
, libksba, coreutils, libiconvOrEmpty
|
||||
, useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null
|
||||
, useUsb ? true, libusb ? null, useCurl ? true, curl ? null
|
||||
# Each of the dependencies below are optional.
|
||||
# Gnupg can be built without them at the cost of reduced functionality.
|
||||
, pinentry ? null, openldap ? null, bzip2 ? null, libusb ? null, curl ? null
|
||||
}:
|
||||
|
||||
assert useLdap -> (openldap != null);
|
||||
assert useBzip2 -> (bzip2 != null);
|
||||
assert useUsb -> (libusb != null);
|
||||
assert useCurl -> (curl != null);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gnupg-2.0.26";
|
||||
|
||||
@@ -21,19 +14,19 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
buildInputs
|
||||
= [ readline zlib libgpgerror libgcrypt libassuan libksba pth ]
|
||||
++ libiconvOrEmpty
|
||||
++ stdenv.lib.optional useLdap openldap
|
||||
++ stdenv.lib.optional useBzip2 bzip2
|
||||
++ stdenv.lib.optional useUsb libusb
|
||||
++ stdenv.lib.optional useCurl curl;
|
||||
= [ readline zlib libgpgerror libgcrypt libassuan libksba pth
|
||||
openldap bzip2 libusb curl ]
|
||||
++ libiconvOrEmpty;
|
||||
|
||||
patchPhase = ''
|
||||
find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i
|
||||
find . -name pcsc-wrapper.c | xargs sed -i 's/typedef unsinged int pcsc_dword_t/typedef unsigned int pcsc_dword_t/'
|
||||
patch gl/stdint_.h < ${./clang.patch}
|
||||
'';
|
||||
|
||||
configureFlags =
|
||||
if pinentry != null then "--with-pinentry-pgm=${pinentry}/bin/pinentry"
|
||||
else "";
|
||||
|
||||
checkPhase="GNUPGHOME=`pwd` ./agent/gpg-agent --daemon make check";
|
||||
|
||||
doCheck = true;
|
||||
@@ -55,7 +48,7 @@ stdenv.mkDerivation rec {
|
||||
S/MIME.
|
||||
'';
|
||||
|
||||
maintainers = with stdenv.lib.maintainers; [ urkud ];
|
||||
maintainers = with stdenv.lib.maintainers; [ roconnor urkud ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# Remember to install Pinentry and
|
||||
# 'echo "pinentry-program `which pinentry-gtk-2`" >> ~/.gnupg/gpg-agent.conf'.
|
||||
|
||||
{ fetchgit, stdenv, readline, zlib, libgpgerror, npth, libgcrypt, libassuan
|
||||
, libksba, coreutils, autoconf, automake, transfig, ghostscript, texinfo
|
||||
, useLdap ? true, openldap ? null, useBzip2 ? true, bzip2 ? null, useUsb ? true
|
||||
, libusb ? null, useCurl ? true, curl ? null
|
||||
}:
|
||||
|
||||
assert useLdap -> (openldap != null);
|
||||
assert useBzip2 -> (bzip2 != null);
|
||||
assert useUsb -> (libusb != null);
|
||||
assert useCurl -> (curl != null);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gnupg-2.1pre-git20120407";
|
||||
|
||||
src = fetchgit {
|
||||
url = "git://git.gnupg.org/gnupg.git";
|
||||
rev = "f1e1387bee286c7434f0462185048872bcdb4484";
|
||||
sha256 = "8f5a14587beccdd3752f9e430e56c6ea2d393dddb7843bfc17029e1a309045bb";
|
||||
};
|
||||
|
||||
buildInputs = [ readline zlib libgpgerror npth libgcrypt libassuan libksba
|
||||
autoconf automake transfig ghostscript texinfo ]
|
||||
++ stdenv.lib.optional useLdap openldap
|
||||
++ stdenv.lib.optional useBzip2 bzip2
|
||||
++ stdenv.lib.optional useUsb libusb
|
||||
++ stdenv.lib.optional useCurl curl;
|
||||
|
||||
patchPhase = ''
|
||||
find tests -type f | xargs sed -e 's@/bin/pwd@${coreutils}&@g' -i
|
||||
'';
|
||||
|
||||
preConfigure = "autoreconf -v";
|
||||
configureFlags = "--enable-maintainer-mode";
|
||||
|
||||
meta = {
|
||||
description = "GNU Privacy Guard (GnuPG), GNU Project's implementation of the OpenPGP standard";
|
||||
|
||||
longDescription = ''
|
||||
GnuPG is the GNU project's complete and free implementation of
|
||||
the OpenPGP standard as defined by RFC4880. GnuPG allows to
|
||||
encrypt and sign your data and communication, features a
|
||||
versatile key managment system as well as access modules for all
|
||||
kind of public key directories. GnuPG, also known as GPG, is a
|
||||
command line tool with features for easy integration with other
|
||||
applications. A wealth of frontend applications and libraries
|
||||
are available. Version 2 of GnuPG also provides support for
|
||||
S/MIME.
|
||||
'';
|
||||
|
||||
homepage = http://gnupg.org/;
|
||||
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
};
|
||||
}
|
||||
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
|
||||
|
||||
buildFlags = "QMAKE=qmake";
|
||||
|
||||
buildInputs = [ openssl pcre qt4 boost pkcs11helper ];
|
||||
buildInputs = [ openssl pcre qt4 boost boost.lib pkcs11helper ];
|
||||
|
||||
preConfigure = ''
|
||||
sed -i s,-mt$,, meo-gui/meo-gui.pro
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{ stdenv, fetchurl, pkgconfig, libnfc }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "mfoc-${version}";
|
||||
version = "0.10.6";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://mfoc.googlecode.com/files/${name}.tar.gz";
|
||||
sha1 = "3adce3029dce9124ff3bc7d0fad86fa0c374a9e3";
|
||||
};
|
||||
|
||||
patches = [./mf_mini.patch];
|
||||
|
||||
buildInputs = [ pkgconfig libnfc ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Mifare Classic Offline Cracker";
|
||||
license = licenses.gpl2;
|
||||
homepage = http://code.google.com/p/mfoc/;
|
||||
maintainers = with maintainers; [ offline ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
diff --git a/src/mfoc.c b/src/mfoc.c
|
||||
index 0cb917d..195de68 100644
|
||||
--- a/src/mfoc.c
|
||||
+++ b/src/mfoc.c
|
||||
@@ -93,8 +93,8 @@ int main(int argc, char *const argv[])
|
||||
{0x58, 0x7e, 0xe5, 0xf9, 0x35, 0x0f},
|
||||
{0xa0, 0x47, 0x8c, 0xc3, 0x90, 0x91},
|
||||
{0x53, 0x3c, 0xb6, 0xc7, 0x23, 0xf6},
|
||||
- {0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9}
|
||||
-
|
||||
+ {0x8f, 0xd0, 0xa4, 0xf2, 0x56, 0xe9},
|
||||
+ {0xb4, 0xc1, 0x32, 0x43, 0x9e, 0xef}
|
||||
};
|
||||
|
||||
mftag t;
|
||||
@@ -219,12 +219,31 @@ int main(int argc, char *const argv[])
|
||||
goto error;
|
||||
}
|
||||
|
||||
- // Save tag's block size (b4K)
|
||||
- t.b4K = (t.nt.nti.nai.abtAtqa[1] == 0x02);
|
||||
t.authuid = (uint32_t) bytes_to_num(t.nt.nti.nai.abtUid + t.nt.nti.nai.szUidLen - 4, 4);
|
||||
|
||||
- t.num_blocks = (t.b4K) ? 0xff : 0x3f;
|
||||
- t.num_sectors = t.b4K ? NR_TRAILERS_4k : NR_TRAILERS_1k;
|
||||
+ // Get Mifare Classic type from SAK
|
||||
+ // see http://www.nxp.com/documents/application_note/AN10833.pdf Section 3.2
|
||||
+ switch (t.nt.nti.nai.btSak)
|
||||
+ {
|
||||
+ case 0x08:
|
||||
+ printf("Found Mifare Classic 1k tag\n");
|
||||
+ t.num_sectors = NR_TRAILERS_1k;
|
||||
+ t.num_blocks = NR_BLOCKS_1k;
|
||||
+ break;
|
||||
+ case 0x09:
|
||||
+ printf("Found Mifare Classic Mini tag\n");
|
||||
+ t.num_sectors = NR_TRAILERS_MINI;
|
||||
+ t.num_blocks = NR_BLOCKS_MINI;
|
||||
+ break;
|
||||
+ case 0x18:
|
||||
+ printf("Found Mifare Classic 4k tag\n");
|
||||
+ t.num_sectors = NR_TRAILERS_4k;
|
||||
+ t.num_blocks = NR_BLOCKS_4k;
|
||||
+ break;
|
||||
+ defaul:
|
||||
+ ERR("Cannot determine card type from SAK");
|
||||
+ goto error;
|
||||
+ }
|
||||
|
||||
t.sectors = (void *) calloc(t.num_sectors, sizeof(sector));
|
||||
if (t.sectors == NULL) {
|
||||
@@ -564,7 +583,7 @@ void usage(FILE *stream, int errno)
|
||||
fprintf(stream, " k try the specified key in addition to the default keys\n");
|
||||
// fprintf(stream, " D number of distance probes, default is 20\n");
|
||||
// fprintf(stream, " S number of sets with keystreams, default is 5\n");
|
||||
- fprintf(stream, " P number of probes per sector, instead of default of 20\n");
|
||||
+ fprintf(stream, " P number of probes per sector, instead of default of 150\n");
|
||||
fprintf(stream, " T nonce tolerance half-range, instead of default of 20\n (i.e., 40 for the total range, in both directions)\n");
|
||||
// fprintf(stream, " s specify the list of sectors to crack, for example -s 0,1,3,5\n");
|
||||
fprintf(stream, " O file in which the card contents will be written (REQUIRED)\n");
|
||||
diff --git a/src/mfoc.h b/src/mfoc.h
|
||||
index b411670..532e834 100644
|
||||
--- a/src/mfoc.h
|
||||
+++ b/src/mfoc.h
|
||||
@@ -2,11 +2,21 @@
|
||||
#define TRY_KEYS 50
|
||||
|
||||
// Number of trailers == number of sectors
|
||||
-// 16x64b = 16
|
||||
+// Mifare Classic 1k 16x64b = 16
|
||||
#define NR_TRAILERS_1k (16)
|
||||
-// 32x64b + 8*256b = 40
|
||||
+// Mifare Classic Mini
|
||||
+#define NR_TRAILERS_MINI (5)
|
||||
+// Mifare Classic 4k 32x64b + 8*256b = 40
|
||||
#define NR_TRAILERS_4k (40)
|
||||
|
||||
+// Number of blocks
|
||||
+// Mifare Classic 1k
|
||||
+#define NR_BLOCKS_1k 0x3f
|
||||
+// Mifare Classic Mini
|
||||
+#define NR_BLOCKS_MINI 0x13
|
||||
+// Mifare Classic 4k
|
||||
+#define NR_BLOCKS_4k 0xff
|
||||
+
|
||||
#define MAX_FRAME_LEN 264
|
||||
|
||||
// Used for counting nonce distances, explore [nd-value, nd+value]
|
||||
@@ -46,7 +56,6 @@ typedef struct {
|
||||
uint8_t num_sectors;
|
||||
uint8_t num_blocks;
|
||||
uint32_t authuid;
|
||||
- bool b4K;
|
||||
} mftag;
|
||||
|
||||
typedef struct {
|
||||
@@ -1,12 +1,12 @@
|
||||
{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "1.8.11";
|
||||
version = "1.8.12";
|
||||
name = "pcsclite-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://alioth.debian.org/frs/download.php/file/3991/pcsc-lite-${version}.tar.bz2";
|
||||
sha256 = "945041c94c53959ae5a767616a4ec5099fe67f549bfd344e8bd0cfe7a3c71ac6";
|
||||
sha256 = "1ihsqyiygkyhid739zcvaizyd7q9qm76lqb7lzjrm5ak9k4l2l4l";
|
||||
};
|
||||
|
||||
# The OS should care on preparing the drivers into this location
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{ fetchurl, stdenv, python, gnupg }:
|
||||
|
||||
let version = "2.0.9"; in
|
||||
let version = "2.0.11"; in
|
||||
stdenv.mkDerivation {
|
||||
name = "pius-${version}";
|
||||
namePrefix = "";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/pgpius/pius/${version}/pius-${version}.tar.bz2";
|
||||
sha256 = "1g1jly3wl4ks6h8ydkygyl2c4i7v3z91rg42005m6vm70y1d8b3d";
|
||||
sha256 = "0pdbyqz6k0bm182cz81ss7yckmpms5qhrrw0wcr4a1srzcjyzf5f";
|
||||
};
|
||||
|
||||
buildInputs = [ python ];
|
||||
@@ -41,6 +41,6 @@ stdenv.mkDerivation {
|
||||
license = stdenv.lib.licenses.gpl2;
|
||||
|
||||
platforms = stdenv.lib.platforms.gnu;
|
||||
maintainers = [ ];
|
||||
maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{ stdenv, fetchurl, openssl, libidn, ncurses, pcre, libssh }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "hydra-7.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.thc.org/releases/${name}.tar.gz";
|
||||
sha256 = "1dhavbn2mcm6c2c1qw29ipbpmczax3vhhlxzwn49c8cq471yg4vj";
|
||||
};
|
||||
|
||||
preConfigure = ''
|
||||
substituteInPlace configure --replace "\$LIBDIRS" "${openssl}/lib ${pcre}/lib ${libssh}/lib"
|
||||
substituteInPlace configure --replace "\$INCDIRS" "${openssl}/include ${pcre}/include ${libssh}/include"
|
||||
'';
|
||||
|
||||
buildInputs = [ openssl libidn ncurses pcre libssh ];
|
||||
|
||||
meta = {
|
||||
description = "A very fast network logon cracker which support many different services";
|
||||
license = licenses.agpl3;
|
||||
homepage = https://www.thc.org/thc-hydra/;
|
||||
maintainers = with maintainers; [offline];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user