initial commit

This commit is contained in:
Eric Wheeler 2016-06-13 08:27:43 -07:00
commit c25b202386
129 changed files with 44416 additions and 0 deletions

11
.gitignore vendored Normal file
View File

@ -0,0 +1,11 @@
mysqlexamples
old/
.idea/
app/3rdparty
composer.lock
.*~
*~
composer.phar
mp3/

18
.gitmodules vendored Normal file
View File

@ -0,0 +1,18 @@
[submodule "3rdparty/json"]
path = 3rdparty/json
url = https://github.com/nlohmann/json
[submodule "3rdparty/openwall-bcrypt"]
path = 3rdparty/openwall-bcrypt
url = https://github.com/gigamonkey/openwall-bcrypt
[submodule "3rdparty/bcrypt"]
path = 3rdparty/bcrypt
url = https://github.com/rg3/bcrypt
[submodule "3rdparty/appserver"]
path = 3rdparty/appserver
url = https://github.com/appserver-io/appserver
[submodule "3rdparty/runtime"]
path = 3rdparty/runtime
url = https://github.com/appserver-io-php/runtime.git
[submodule "3rdparty/freebsd"]
path = 3rdparty/freebsd
url = https://github.com/lattera/freebsd

914
3rdparty/crypt_blowfish.c vendored Normal file
View File

@ -0,0 +1,914 @@
/* $Id$ */
/*
* The crypt_blowfish homepage is:
*
* http://www.openwall.com/crypt/
*
* This code comes from John the Ripper password cracker, with reentrant
* and crypt(3) interfaces added, but optimizations specific to password
* cracking removed.
*
* Written by Solar Designer <solar at openwall.com> in 1998-2011.
* No copyright is claimed, and the software is hereby placed in the public
* domain. In case this attempt to disclaim copyright and place the software
* in the public domain is deemed null and void, then the software is
* Copyright (c) 1998-2011 Solar Designer and it is hereby released to the
* general public under the following terms:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* There's ABSOLUTELY NO WARRANTY, express or implied.
*
* It is my intent that you should be able to use this on your system,
* as part of a software package, or anywhere else to improve security,
* ensure compatibility, or for any other purpose. I would appreciate
* it if you give credit where it is due and keep your modifications in
* the public domain as well, but I don't require that in order to let
* you place this code and any modifications you make under a license
* of your choice.
*
* This implementation is mostly compatible with OpenBSD's bcrypt.c (prefix
* "$2a$") by Niels Provos <provos at citi.umich.edu>, and uses some of his
* ideas. The password hashing algorithm was designed by David Mazieres
* <dm at lcs.mit.edu>. For more information on the level of compatibility,
* please refer to the comments in BF_set_key() below and to the crypt(3)
* man page included in the crypt_blowfish tarball.
*
* There's a paper on the algorithm that explains its design decisions:
*
* http://www.usenix.org/events/usenix99/provos.html
*
* Some of the tricks in BF_ROUND might be inspired by Eric Young's
* Blowfish library (I can't be sure if I would think of something if I
* hadn't seen his code).
*/
#ifdef __cplusplus
extern "C" {
#endif
#include <string.h>
#include <errno.h>
#ifndef __set_errno
#define __set_errno(val) errno = (val)
#endif
/* Just to make sure the prototypes match the actual definitions */
#include "crypt_blowfish.h"
#ifdef __i386__
#define BF_ASM 0
#define BF_SCALE 1
#elif defined(__x86_64__) || defined(__alpha__) || defined(__hppa__)
#define BF_ASM 0
#define BF_SCALE 1
#else
#define BF_ASM 0
#define BF_SCALE 0
#endif
typedef unsigned int BF_word;
typedef signed int BF_word_signed;
/* Number of Blowfish rounds, this is also hardcoded into a few places */
#define BF_N 16
typedef BF_word BF_key[BF_N + 2];
typedef struct {
BF_word S[4][0x100];
BF_key P;
} BF_ctx;
/*
* Magic IV for 64 Blowfish encryptions that we do at the end.
* The string is "OrpheanBeholderScryDoubt" on big-endian.
*/
static BF_word BF_magic_w[6] = {
0x4F727068, 0x65616E42, 0x65686F6C,
0x64657253, 0x63727944, 0x6F756274
};
/*
* P-box and S-box tables initialized with digits of Pi.
*/
static BF_ctx BF_init_state = {
{
{
0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
}, {
0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
}, {
0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
}, {
0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
}
}, {
0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
0x9216d5d9, 0x8979fb1b
}
};
static unsigned char BF_itoa64[64 + 1] =
"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
static unsigned char BF_atoi64[0x60] = {
64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64,
64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64,
64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64
};
#define BF_safe_atoi64(dst, src) \
{ \
tmp = (unsigned char)(src); \
if (tmp == '$') break; /* PHP hack */ \
if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \
tmp = BF_atoi64[tmp]; \
if (tmp > 63) return -1; \
(dst) = tmp; \
}
static int BF_decode(BF_word *dst, const char *src, int size)
{
unsigned char *dptr = (unsigned char *)dst;
unsigned char *end = dptr + size;
const unsigned char *sptr = (const unsigned char *)src;
unsigned int tmp, c1, c2, c3, c4;
do {
BF_safe_atoi64(c1, *sptr++);
BF_safe_atoi64(c2, *sptr++);
*dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4);
if (dptr >= end) break;
BF_safe_atoi64(c3, *sptr++);
*dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2);
if (dptr >= end) break;
BF_safe_atoi64(c4, *sptr++);
*dptr++ = ((c3 & 0x03) << 6) | c4;
} while (dptr < end);
while (dptr < end) /* PHP hack */
*dptr++ = 0;
return 0;
}
static void BF_encode(char *dst, const BF_word *src, int size)
{
const unsigned char *sptr = (const unsigned char *)src;
const unsigned char *end = sptr + size;
unsigned char *dptr = (unsigned char *)dst;
unsigned int c1, c2;
do {
c1 = *sptr++;
*dptr++ = BF_itoa64[c1 >> 2];
c1 = (c1 & 0x03) << 4;
if (sptr >= end) {
*dptr++ = BF_itoa64[c1];
break;
}
c2 = *sptr++;
c1 |= c2 >> 4;
*dptr++ = BF_itoa64[c1];
c1 = (c2 & 0x0f) << 2;
if (sptr >= end) {
*dptr++ = BF_itoa64[c1];
break;
}
c2 = *sptr++;
c1 |= c2 >> 6;
*dptr++ = BF_itoa64[c1];
*dptr++ = BF_itoa64[c2 & 0x3f];
} while (sptr < end);
}
static void BF_swap(BF_word *x, int count)
{
static int endianness_check = 1;
char *is_little_endian = (char *)&endianness_check;
BF_word tmp;
if (*is_little_endian)
do {
tmp = *x;
tmp = (tmp << 16) | (tmp >> 16);
*x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF);
} while (--count);
}
#if BF_SCALE
/* Architectures which can shift addresses left by 2 bits with no extra cost */
#define BF_ROUND(L, R, N) \
tmp1 = L & 0xFF; \
tmp2 = L >> 8; \
tmp2 &= 0xFF; \
tmp3 = L >> 16; \
tmp3 &= 0xFF; \
tmp4 = L >> 24; \
tmp1 = data.ctx.S[3][tmp1]; \
tmp2 = data.ctx.S[2][tmp2]; \
tmp3 = data.ctx.S[1][tmp3]; \
tmp3 += data.ctx.S[0][tmp4]; \
tmp3 ^= tmp2; \
R ^= data.ctx.P[N + 1]; \
tmp3 += tmp1; \
R ^= tmp3;
#else
/* Architectures with no complicated addressing modes supported */
#define BF_INDEX(S, i) \
(*((BF_word *)(((unsigned char *)S) + (i))))
#define BF_ROUND(L, R, N) \
tmp1 = L & 0xFF; \
tmp1 <<= 2; \
tmp2 = L >> 6; \
tmp2 &= 0x3FC; \
tmp3 = L >> 14; \
tmp3 &= 0x3FC; \
tmp4 = L >> 22; \
tmp4 &= 0x3FC; \
tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \
tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \
tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \
tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \
tmp3 ^= tmp2; \
R ^= data.ctx.P[N + 1]; \
tmp3 += tmp1; \
R ^= tmp3;
#endif
/*
* Encrypt one block, BF_N is hardcoded here.
*/
#define BF_ENCRYPT \
L ^= data.ctx.P[0]; \
BF_ROUND(L, R, 0); \
BF_ROUND(R, L, 1); \
BF_ROUND(L, R, 2); \
BF_ROUND(R, L, 3); \
BF_ROUND(L, R, 4); \
BF_ROUND(R, L, 5); \
BF_ROUND(L, R, 6); \
BF_ROUND(R, L, 7); \
BF_ROUND(L, R, 8); \
BF_ROUND(R, L, 9); \
BF_ROUND(L, R, 10); \
BF_ROUND(R, L, 11); \
BF_ROUND(L, R, 12); \
BF_ROUND(R, L, 13); \
BF_ROUND(L, R, 14); \
BF_ROUND(R, L, 15); \
tmp4 = R; \
R = L; \
L = tmp4 ^ data.ctx.P[BF_N + 1];
#if BF_ASM
#define BF_body() \
_BF_body_r(&data.ctx);
#else
#define BF_body() \
L = R = 0; \
ptr = data.ctx.P; \
do { \
ptr += 2; \
BF_ENCRYPT; \
*(ptr - 2) = L; \
*(ptr - 1) = R; \
} while (ptr < &data.ctx.P[BF_N + 2]); \
\
ptr = data.ctx.S[0]; \
do { \
ptr += 2; \
BF_ENCRYPT; \
*(ptr - 2) = L; \
*(ptr - 1) = R; \
} while (ptr < &data.ctx.S[3][0xFF]);
#endif
static void BF_set_key(const char *key, BF_key expanded, BF_key initial,
unsigned char flags)
{
const char *ptr = key;
unsigned int bug, i, j;
BF_word safety, sign, diff, tmp[2];
/*
* There was a sign extension bug in older revisions of this function. While
* we would have liked to simply fix the bug and move on, we have to provide
* a backwards compatibility feature (essentially the bug) for some systems and
* a safety measure for some others. The latter is needed because for certain
* multiple inputs to the buggy algorithm there exist easily found inputs to
* the correct algorithm that produce the same hash. Thus, we optionally
* deviate from the correct algorithm just enough to avoid such collisions.
* While the bug itself affected the majority of passwords containing
* characters with the 8th bit set (although only a percentage of those in a
* collision-producing way), the anti-collision safety measure affects
* only a subset of passwords containing the '\xff' character (not even all of
* those passwords, just some of them). This character is not found in valid
* UTF-8 sequences and is rarely used in popular 8-bit character encodings.
* Thus, the safety measure is unlikely to cause much annoyance, and is a
* reasonable tradeoff to use when authenticating against existing hashes that
* are not reliably known to have been computed with the correct algorithm.
*
* We use an approach that tries to minimize side-channel leaks of password
* information - that is, we mostly use fixed-cost bitwise operations instead
* of branches or table lookups. (One conditional branch based on password
* length remains. It is not part of the bug aftermath, though, and is
* difficult and possibly unreasonable to avoid given the use of C strings by
* the caller, which results in similar timing leaks anyway.)
*
* For actual implementation, we set an array index in the variable "bug"
* (0 means no bug, 1 means sign extension bug emulation) and a flag in the
* variable "safety" (bit 16 is set when the safety measure is requested).
* Valid combinations of settings are:
*
* Prefix "$2a$": bug = 0, safety = 0x10000
* Prefix "$2x$": bug = 1, safety = 0
* Prefix "$2y$": bug = 0, safety = 0
*/
bug = (unsigned int)flags & 1;
safety = ((BF_word)flags & 2) << 15;
sign = diff = 0;
for (i = 0; i < BF_N + 2; i++) {
tmp[0] = tmp[1] = 0;
for (j = 0; j < 4; j++) {
tmp[0] <<= 8;
tmp[0] |= (unsigned char)*ptr; /* correct */
tmp[1] <<= 8;
tmp[1] |= (BF_word_signed)(signed char)*ptr; /* bug */
/*
* Sign extension in the first char has no effect - nothing to overwrite yet,
* and those extra 24 bits will be fully shifted out of the 32-bit word. For
* chars 2, 3, 4 in each four-char block, we set bit 7 of "sign" if sign
* extension in tmp[1] occurs. Once this flag is set, it remains set.
*/
if (j)
sign |= tmp[1] & 0x80;
if (!*ptr)
ptr = key;
else
ptr++;
}
diff |= tmp[0] ^ tmp[1]; /* Non-zero on any differences */
expanded[i] = tmp[bug];
initial[i] = BF_init_state.P[i] ^ tmp[bug];
}
/*
* At this point, "diff" is zero iff the correct and buggy algorithms produced
* exactly the same result. If so and if "sign" is non-zero, which indicates
* that there was a non-benign sign extension, this means that we have a
* collision between the correctly computed hash for this password and a set of
* passwords that could be supplied to the buggy algorithm. Our safety measure
* is meant to protect from such many-buggy to one-correct collisions, by
* deviating from the correct algorithm in such cases. Let's check for this.
*/
diff |= diff >> 16; /* still zero iff exact match */
diff &= 0xffff; /* ditto */
diff += 0xffff; /* bit 16 set iff "diff" was non-zero (on non-match) */
sign <<= 9; /* move the non-benign sign extension flag to bit 16 */
sign &= ~diff & safety; /* action needed? */
/*
* If we have determined that we need to deviate from the correct algorithm,
* flip bit 16 in initial expanded key. (The choice of 16 is arbitrary, but
* let's stick to it now. It came out of the approach we used above, and it's
* not any worse than any other choice we could make.)
*
* It is crucial that we don't do the same to the expanded key used in the main
* Eksblowfish loop. By doing it to only one of these two, we deviate from a
* state that could be directly specified by a password to the buggy algorithm
* (and to the fully correct one as well, but that's a side-effect).
*/
initial[0] ^= sign;
}
static char *BF_crypt(const char *key, const char *setting,
char *output, int size,
BF_word min)
{
#if BF_ASM
extern void _BF_body_r(BF_ctx *ctx);
#endif
static const unsigned char flags_by_subtype[26] =
{2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 4, 0};
struct {
BF_ctx ctx;
BF_key expanded_key;
union {
BF_word salt[4];
BF_word output[6];
} binary;
} data;
BF_word L, R;
BF_word tmp1, tmp2, tmp3, tmp4;
BF_word *ptr;
BF_word count;
int i;
if (size < 7 + 22 + 31 + 1) {
__set_errno(ERANGE);
return NULL;
}
if (setting[0] != '$' ||
setting[1] != '2' ||
setting[2] < 'a' || setting[2] > 'z' ||
!flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a'] ||
setting[3] != '$' ||
setting[4] < '0' || setting[4] > '3' ||
setting[5] < '0' || setting[5] > '9' ||
(setting[4] == '3' && setting[5] > '1') ||
setting[6] != '$') {
__set_errno(EINVAL);
return NULL;
}
count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0'));
if (count < min || BF_decode(data.binary.salt, &setting[7], 16)) {
__set_errno(EINVAL);
return NULL;
}
BF_swap(data.binary.salt, 4);
BF_set_key(key, data.expanded_key, data.ctx.P,
flags_by_subtype[(unsigned int)(unsigned char)setting[2] - 'a']);
memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S));
L = R = 0;
for (i = 0; i < BF_N + 2; i += 2) {
L ^= data.binary.salt[i & 2];
R ^= data.binary.salt[(i & 2) + 1];
BF_ENCRYPT;
data.ctx.P[i] = L;
data.ctx.P[i + 1] = R;
}
ptr = data.ctx.S[0];
do {
ptr += 4;
L ^= data.binary.salt[(BF_N + 2) & 3];
R ^= data.binary.salt[(BF_N + 3) & 3];
BF_ENCRYPT;
*(ptr - 4) = L;
*(ptr - 3) = R;
L ^= data.binary.salt[(BF_N + 4) & 3];
R ^= data.binary.salt[(BF_N + 5) & 3];
BF_ENCRYPT;
*(ptr - 2) = L;
*(ptr - 1) = R;
} while (ptr < &data.ctx.S[3][0xFF]);
do {
int done;
for (i = 0; i < BF_N + 2; i += 2) {
data.ctx.P[i] ^= data.expanded_key[i];
data.ctx.P[i + 1] ^= data.expanded_key[i + 1];
}
done = 0;
do {
BF_body();
if (done)
break;
done = 1;
tmp1 = data.binary.salt[0];
tmp2 = data.binary.salt[1];
tmp3 = data.binary.salt[2];
tmp4 = data.binary.salt[3];
for (i = 0; i < BF_N; i += 4) {
data.ctx.P[i] ^= tmp1;
data.ctx.P[i + 1] ^= tmp2;
data.ctx.P[i + 2] ^= tmp3;
data.ctx.P[i + 3] ^= tmp4;
}
data.ctx.P[16] ^= tmp1;
data.ctx.P[17] ^= tmp2;
} while (1);
} while (--count);
for (i = 0; i < 6; i += 2) {
L = BF_magic_w[i];
R = BF_magic_w[i + 1];
count = 64;
do {
BF_ENCRYPT;
} while (--count);
data.binary.output[i] = L;
data.binary.output[i + 1] = R;
}
memcpy(output, setting, 7 + 22 - 1);
output[7 + 22 - 1] = BF_itoa64[(int)
BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30];
/* This has to be bug-compatible with the original implementation, so
* only encode 23 of the 24 bytes. :-) */
BF_swap(data.binary.output, 6);
BF_encode(&output[7 + 22], data.binary.output, 23);
output[7 + 22 + 31] = '\0';
return output;
}
static int _crypt_output_magic(const char *setting, char *output, int size)
{
if (size < 3)
return -1;
output[0] = '*';
output[1] = '0';
output[2] = '\0';
if (setting[0] == '*' && setting[1] == '0')
output[1] = '1';
return 0;
}
/*
* Please preserve the runtime self-test. It serves two purposes at once:
*
* 1. We really can't afford the risk of producing incompatible hashes e.g.
* when there's something like gcc bug 26587 again, whereas an application or
* library integrating this code might not also integrate our external tests or
* it might not run them after every build. Even if it does, the miscompile
* might only occur on the production build, but not on a testing build (such
* as because of different optimization settings). It is painful to recover
* from incorrectly-computed hashes - merely fixing whatever broke is not
* enough. Thus, a proactive measure like this self-test is needed.
*
* 2. We don't want to leave sensitive data from our actual password hash
* computation on the stack or in registers. Previous revisions of the code
* would do explicit cleanups, but simply running the self-test after hash
* computation is more reliable.
*
* The performance cost of this quick self-test is around 0.6% at the "$2a$08"
* setting.
*/
char *php_crypt_blowfish_rn(const char *key, const char *setting,
char *output, int size)
{
const char *test_key = "8b \xd0\xc1\xd2\xcf\xcc\xd8";
const char *test_setting = "$2a$00$abcdefghijklmnopqrstuu";
static const char * const test_hash[2] =
{"VUrPmXD6q/nVSSp7pNDhCR9071IfIRe\0\x55", /* $2x$ */
"i1D709vfamulimlGcq0qq3UvuUasvEa\0\x55"}; /* $2a$, $2y$ */
char *retval;
const char *p;
int save_errno, ok;
struct {
char s[7 + 22 + 1];
char o[7 + 22 + 31 + 1 + 1 + 1];
} buf;
/* Hash the supplied password */
_crypt_output_magic(setting, output, size);
retval = BF_crypt(key, setting, output, size, 16);
save_errno = errno;
/*
* Do a quick self-test. It is important that we make both calls to BF_crypt()
* from the same scope such that they likely use the same stack locations,
* which makes the second call overwrite the first call's sensitive data on the
* stack and makes it more likely that any alignment related issues would be
* detected by the self-test.
*/
memcpy(buf.s, test_setting, sizeof(buf.s));
if (retval)
buf.s[2] = setting[2];
memset(buf.o, 0x55, sizeof(buf.o));
buf.o[sizeof(buf.o) - 1] = 0;
p = BF_crypt(test_key, buf.s, buf.o, sizeof(buf.o) - (1 + 1), 1);
ok = (p == buf.o &&
!memcmp(p, buf.s, 7 + 22) &&
!memcmp(p + (7 + 22),
test_hash[(unsigned int)(unsigned char)buf.s[2] & 1],
31 + 1 + 1 + 1));
{
const char *k = "\xff\xa3" "34" "\xff\xff\xff\xa3" "345";
BF_key ae, ai, ye, yi;
BF_set_key(k, ae, ai, 2); /* $2a$ */
BF_set_key(k, ye, yi, 4); /* $2y$ */
ai[0] ^= 0x10000; /* undo the safety (for comparison) */
ok = ok && ai[0] == 0xdb9c59bc && ye[17] == 0x33343500 &&
!memcmp(ae, ye, sizeof(ae)) &&
!memcmp(ai, yi, sizeof(ai));
}
__set_errno(save_errno);
if (ok)
return retval;
/* Should not happen */
_crypt_output_magic(setting, output, size);
__set_errno(EINVAL); /* pretend we don't support this hash type */
return NULL;
}
//#if 0
char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
const char *input, int size, char *output, int output_size)
{
if (size < 16 || output_size < 7 + 22 + 1 ||
(count && (count < 4 || count > 31)) ||
prefix[0] != '$' || prefix[1] != '2' ||
(prefix[2] != 'a' && prefix[2] != 'y')) {
if (output_size > 0) output[0] = '\0';
__set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
return NULL;
}
if (!count) count = 5;
output[0] = '$';
output[1] = '2';
output[2] = prefix[2];
output[3] = '$';
output[4] = '0' + count / 10;
output[5] = '0' + count % 10;
output[6] = '$';
BF_encode(&output[7], (const BF_word *)input, 16);
output[7 + 22] = '\0';
return output;
}
//#endif
#ifdef __cplusplus
}
#endif

34
3rdparty/crypt_blowfish.h vendored Normal file
View File

@ -0,0 +1,34 @@
/* $Id$ */
/*
* Written by Solar Designer <solar at openwall.com> in 2000-2011.
* No copyright is claimed, and the software is hereby placed in the public
* domain. In case this attempt to disclaim copyright and place the software
* in the public domain is deemed null and void, then the software is
* Copyright (c) 2000-2011 Solar Designer and it is hereby released to the
* general public under the following terms:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted.
*
* There's ABSOLUTELY NO WARRANTY, express or implied.
*
* See crypt_blowfish.c for more information.
*/
#ifndef _CRYPT_BLOWFISH_H
#define _CRYPT_BLOWFISH_H
#ifdef __cplusplus
extern "C" {
#endif
unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length);
int password_hash(const char *pass, int cost, char *crpt);
extern char *php_crypt_blowfish_rn(const char *key, const char *setting, char *output, int size);
char *_crypt_gensalt_blowfish_rn(const char *prefix, unsigned long count,
const char *input, int size, char *output, int output_size);
#ifdef __cplusplus
}
#endif
#endif

82
3rdparty/crypto.cc vendored Normal file
View File

@ -0,0 +1,82 @@
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <openssl/evp.h>
#include <openssl/bio.h>
using namespace std;
int calcDecodeLength(const char *b64input, const size_t length) {
int padding = 0;
// Check for trailing '=''s as padding
if(b64input[length-1] == '=' && b64input[length-2] == '=')
padding = 2;
else if (b64input[length-1] == '=')
padding = 1;
return (int)length*0.75 - padding;
}
char* base64_encode(const char *message, const size_t length) {
BIO *bio;
BIO *b64;
FILE* stream;
int encodedSize = 4*ceil((double)length/3);
char *buffer = (char*)malloc(encodedSize+1);
if(buffer == NULL) {
fprintf(stderr, "Failed to allocate memory\n");
exit(1);
}
stream = fmemopen(buffer, encodedSize+1, "w");
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_fp(stream, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
BIO_write(bio, message, length);
(void)BIO_flush(bio);
BIO_free_all(bio);
fclose(stream);
return buffer;
}
int base64_decode(const char *b64message, const size_t length, unsigned char **buffer) {
BIO *bio;
BIO *b64;
int decodedLength = calcDecodeLength(b64message, length);
*buffer = (unsigned char*)malloc(decodedLength+1);
if(*buffer == NULL) {
fprintf(stderr, "Failed to allocate memory\n");
exit(1);
}
FILE* stream = fmemopen((char*)b64message, length, "r");
b64 = BIO_new(BIO_f_base64());
bio = BIO_new_fp(stream, BIO_NOCLOSE);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
decodedLength = BIO_read(bio, *buffer, length);
(*buffer)[decodedLength] = '\0';
BIO_free_all(bio);
fclose(stream);
return decodedLength;
}
int main(int argc, char * argv[]) {
const char *message;
if(argc > 1) {
message = argv[1];
} else {
message = "This isjlakjsdflkjalsfjasdlfjasdldjf a message.";
}
cout << base64_encode(message, strlen(message)) << endl;
return 0;
}

185
3rdparty/hash.cc vendored Normal file
View File

@ -0,0 +1,185 @@
#include <cstdio>
#include <cstring>
#include <iostream>
#include <fcntl.h>
#include <limits.h>
#include <cstdlib>
#include <math.h>
#include <unistd.h>
#include "crypt_blowfish.h"
#define BF_MAX_SALT_LEN 60
#define RANDBYTES 16
static const char base64_table[] =
{ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/', '\0'
};
static const char base64_pad = '=';
unsigned char *php_base64_encode(const unsigned char *str, int length, int *ret_length)
{
const unsigned char *current = str;
unsigned char *p;
unsigned char *result;
if ((length + 2) < 0 || ((length + 2) / 3) >= (1 << (sizeof(int) * 8 - 2))) {
if (ret_length != NULL) {
*ret_length = 0;
}
return NULL;
}
result = (unsigned char *)malloc(((length + 2) / 3) * 4);
p = result;
while (length > 2) { /* keep going until we have less than 24 bits */
*p++ = base64_table[current[0] >> 2];
*p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)];
*p++ = base64_table[((current[1] & 0x0f) << 2) + (current[2] >> 6)];
*p++ = base64_table[current[2] & 0x3f];
current += 3;
length -= 3; /* we just handle 3 octets of data */
}
/* now deal with the tail end of things */
if (length != 0) {
*p++ = base64_table[current[0] >> 2];
if (length > 1) {
*p++ = base64_table[((current[0] & 0x03) << 4) + (current[1] >> 4)];
*p++ = base64_table[(current[1] & 0x0f) << 2];
*p++ = base64_pad;
} else {
*p++ = base64_table[(current[0] & 0x03) << 4];
*p++ = base64_pad;
*p++ = base64_pad;
}
}
if (ret_length != NULL) {
*ret_length = (int)(p - result);
}
*p = '\0';
return result;
}
static int php_password_salt_to64(const char *str, const size_t str_len, const size_t out_len, char *ret)
{
size_t pos = 0;
size_t ret_len = 0;
unsigned char *buffer;
if ((int) str_len < 0) {
return 1;
}
buffer = php_base64_encode((unsigned char*) str, (int) str_len, (int*) &ret_len);
if (ret_len < out_len) {
/* Too short of an encoded string generated */
free(buffer);
return 1;
}
for (pos = 0; pos < out_len; pos++) {
if (buffer[pos] == '+') {
ret[pos] = '.';
} else if (buffer[pos] == '=') {
free(buffer);
return 1;
} else {
ret[pos] = buffer[pos];
}
}
free(buffer);
return 0;
}
static int blowfish_make_salt(size_t length, char *ret)
{
int buffer_valid = 0;
size_t i, raw_length;
char *buffer;
char *result;
if (length > (INT_MAX / 3)) {
perror("Length is too large to safely generate");
return 1;
}
raw_length = length * 3 / 4 + 1;
buffer = (char*)malloc(raw_length);
{
int fd, n;
size_t read_bytes = 0;
fd = open("/dev/urandom", O_RDONLY);
if (fd >= 0) {
while (read_bytes < raw_length) {
n = read(fd, buffer + read_bytes, raw_length - read_bytes);
if (n < 0) {
break;
}
read_bytes += (size_t) n;
}
close(fd);
}
if (read_bytes >= raw_length) {
buffer_valid = 1;
}
}
if (!buffer_valid) {
for (i = 0; i < raw_length; i++) {
buffer[i] ^= (char) (255.0 * rand() / RAND_MAX);
}
}
result = (char*)malloc(length);
if (php_password_salt_to64(buffer, raw_length, length, result) == 1) {
perror("Generated salt too short");
free(buffer);
free(result);
return 1;
}
memcpy(ret, result, length);
free(result);
free(buffer);
ret[length] = 0;
return 0;
}
int password_hash(const char *pass, int cost, char *crpt)
{
static long required_salt_len = 22;
char *newsalt,*output, *final;
char crypted[BF_MAX_SALT_LEN +1];
char salt[required_salt_len];
output = (char*)malloc(32);
memset(crypted, 0, BF_MAX_SALT_LEN + 1);
blowfish_make_salt(required_salt_len, salt);
newsalt = _crypt_gensalt_blowfish_rn("$2y$", cost, salt, required_salt_len, output, 30);
final = php_crypt_blowfish_rn(pass, newsalt, crypted, sizeof(crypted));
free(output);
strcpy(crpt,final);
return 0;
}
#ifdef BCRYPT_TEST
int main(int argc, char * argv[]) {
char * hash;
const char * pass = "testpassword";
int ret;
hash = (char*)malloc(BF_MAX_SALT_LEN +1);
if(argc > 1) {
ret = password_hash(argv[1], 10, hash);
} else {
ret = password_hash(pass,10, hash);
}
printf("hash : %s\n",hash);
free(hash);
return 0;
}
#endif

BIN
3rdparty/libbcrypt-1.0/bin/bcrypt.so vendored Executable file

Binary file not shown.

View File

@ -0,0 +1,5 @@
../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c \
../../source/include/bcrypt.h ../../source/include/includes.h \
../../source/include/defines.h ../../source/include/functions.h \
../../source/include/includes.h ../../source/include/blowfish.h \
../../source/include/config.h

Binary file not shown.

View File

@ -0,0 +1,3 @@
../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/blowfish.h

Binary file not shown.

View File

@ -0,0 +1,4 @@
../../bin/bcrypt_endian.o: ../../source/src/endian.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/functions.h ../../source/include/includes.h \
../../source/include/blowfish.h

Binary file not shown.

View File

@ -0,0 +1,4 @@
../../bin/bcrypt_keys.o: ../../source/src/keys.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/functions.h ../../source/include/includes.h \
../../source/include/blowfish.h

BIN
3rdparty/libbcrypt-1.0/bin/bcrypt_keys.o vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,4 @@
../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/functions.h ../../source/include/includes.h \
../../source/include/blowfish.h

Binary file not shown.

View File

@ -0,0 +1,4 @@
../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/functions.h ../../source/include/includes.h \
../../source/include/blowfish.h

Binary file not shown.

View File

@ -0,0 +1,4 @@
../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c \
../../source/include/includes.h ../../source/include/defines.h \
../../source/include/functions.h ../../source/include/includes.h \
../../source/include/blowfish.h

Binary file not shown.

View File

@ -0,0 +1,182 @@
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

View File

@ -0,0 +1,99 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
prefix = /usr/local
exec_prefix = ${prefix}
INSTALL = /usr/bin/install -c
SHARED_LD_MODULE_CC = $(CC) -shared -fPIC -o
SO_SUFFIX_MODULE = so
PIC_FLAG = -fPIC -DPIC
STRIP = strip
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DIR = $(INSTALL) -d
BK_DEPS = /home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps
DLLPREFIX_MODULE =
LIBS =
CC = gcc
CFLAGS = -g -O2
CPPFLAGS =
LDFLAGS =
### Variables: ###
DESTDIR =
BCRYPT_CFLAGS = -I../../source/include $(PIC_FLAG) $(CPPFLAGS) $(CFLAGS)
BCRYPT_OBJECTS = \
../../bin/bcrypt_bcrypt.o \
../../bin/bcrypt_blowfish.o \
../../bin/bcrypt_endian.o \
../../bin/bcrypt_keys.o \
../../bin/bcrypt_rwfile.o \
../../bin/bcrypt_wrapbf.o \
../../bin/bcrypt_wrapzl.o
### Conditionally set variables: ###
CCC = $(BK_DEPS) $(CC)
#CCC = $(CC)
### Targets: ###
all: ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
install: all install_bcrypt
uninstall: uninstall_bcrypt
install-strip: install
$(STRIP) $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
clean:
rm -rf ../../bin/.deps ../../bin/.pch
rm -f ../../bin/*.o
rm -f ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE): $(BCRYPT_OBJECTS)
$(SHARED_LD_MODULE_CC) $@ $(BCRYPT_OBJECTS) $(LDFLAGS) $(LIBS)
install_bcrypt:
$(INSTALL_DIR) $(DESTDIR)/usr/local/lib
$(INSTALL_PROGRAM) ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) $(DESTDIR)/usr/local/lib
uninstall_bcrypt:
rm -f $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/bcrypt.c
../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/blowfish.c
../../bin/bcrypt_endian.o: ../../source/src/endian.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/endian.c
../../bin/bcrypt_keys.o: ../../source/src/keys.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/keys.c
../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/rwfile.c
../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapbf.c
../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapzl.c
# Include dependency info, if present:
-include .deps/*.d
.PHONY: all install uninstall clean distclean install_bcrypt uninstall_bcrypt

View File

@ -0,0 +1,99 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@MAKE_SET@
prefix = @prefix@
exec_prefix = @exec_prefix@
INSTALL = @INSTALL@
SHARED_LD_MODULE_CC = @SHARED_LD_MODULE_CC@
SO_SUFFIX_MODULE = @SO_SUFFIX_MODULE@
PIC_FLAG = @PIC_FLAG@
STRIP = @STRIP@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DIR = @INSTALL_DIR@
BK_DEPS = @BK_DEPS@
DLLPREFIX_MODULE = @DLLPREFIX_MODULE@
LIBS = @LIBS@
CC = @CC@
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
### Variables: ###
DESTDIR =
BCRYPT_CFLAGS = -I../../source/include $(PIC_FLAG) $(CPPFLAGS) $(CFLAGS)
BCRYPT_OBJECTS = \
../../bin/bcrypt_bcrypt.o \
../../bin/bcrypt_blowfish.o \
../../bin/bcrypt_endian.o \
../../bin/bcrypt_keys.o \
../../bin/bcrypt_rwfile.o \
../../bin/bcrypt_wrapbf.o \
../../bin/bcrypt_wrapzl.o
### Conditionally set variables: ###
@COND_DEPS_TRACKING_1@CCC = $(BK_DEPS) $(CC)
@COND_DEPS_TRACKING_0@CCC = $(CC)
### Targets: ###
all: ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
install: all install_bcrypt
uninstall: uninstall_bcrypt
install-strip: install
$(STRIP) $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
clean:
rm -rf ../../bin/.deps ../../bin/.pch
rm -f ../../bin/*.o
rm -f ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE): $(BCRYPT_OBJECTS)
$(SHARED_LD_MODULE_CC) $@ $(BCRYPT_OBJECTS) $(LDFLAGS) $(LIBS)
install_bcrypt:
$(INSTALL_DIR) $(DESTDIR)/usr/local/lib
$(INSTALL_PROGRAM) ../../bin/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE) $(DESTDIR)/usr/local/lib
uninstall_bcrypt:
rm -f $(DESTDIR)/usr/local/lib/$(DLLPREFIX_MODULE)bcrypt.$(SO_SUFFIX_MODULE)
../../bin/bcrypt_bcrypt.o: ../../source/src/bcrypt.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/bcrypt.c
../../bin/bcrypt_blowfish.o: ../../source/src/blowfish.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/blowfish.c
../../bin/bcrypt_endian.o: ../../source/src/endian.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/endian.c
../../bin/bcrypt_keys.o: ../../source/src/keys.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/keys.c
../../bin/bcrypt_rwfile.o: ../../source/src/rwfile.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/rwfile.c
../../bin/bcrypt_wrapbf.o: ../../source/src/wrapbf.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapbf.c
../../bin/bcrypt_wrapzl.o: ../../source/src/wrapzl.c
$(CCC) -c -o $@ $(BCRYPT_CFLAGS) ../../source/src/wrapzl.c
# Include dependency info, if present:
@IF_GNU_MAKE@-include .deps/*.d
.PHONY: all install uninstall clean distclean install_bcrypt uninstall_bcrypt

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,20 @@
dnl ### begin block 00_header[bakefile.bkl] ###
dnl
dnl This macro was generated by
dnl Bakefile 0.2.2 (http://bakefile.sourceforge.net)
dnl Do not modify, all changes will be overwritten!
BAKEFILE_AUTOCONF_INC_M4_VERSION="0.2.2"
dnl ### begin block 20_COND_DEPS_TRACKING_0[bakefile.bkl] ###
COND_DEPS_TRACKING_0="#"
if test "x$DEPS_TRACKING" = "x0" ; then
COND_DEPS_TRACKING_0=""
fi
AC_SUBST(COND_DEPS_TRACKING_0)
dnl ### begin block 20_COND_DEPS_TRACKING_1[bakefile.bkl] ###
COND_DEPS_TRACKING_1="#"
if test "x$DEPS_TRACKING" = "x1" ; then
COND_DEPS_TRACKING_1=""
fi
AC_SUBST(COND_DEPS_TRACKING_1)

View File

@ -0,0 +1,5 @@
#!/bin/bash
bakefile -f autoconf bakefile.bkl
bakefilize --copy
aclocal -I /usr/local/share/aclocal
autoconf

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,106 @@
# This file was generated by Autom4te Sun Sep 7 11:40:11 UTC 2014.
# It contains the lists of macros which have been traced.
# It can be safely removed.
@request = (
bless( [
'0',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'-',
'/usr/share/aclocal-1.14/internal/ac-config-macro-dirs.m4',
'configure.ac'
],
{
'AC_CONFIG_MACRO_DIR' => 1,
'include' => 1,
'm4_include' => 1,
'AC_DEFUN' => 1,
'm4_pattern_allow' => 1,
'AU_DEFUN' => 1,
'_m4_warn' => 1,
'_AM_AUTOCONF_VERSION' => 1,
'_AM_CONFIG_MACRO_DIRS' => 1,
'AC_DEFUN_ONCE' => 1,
'AC_CONFIG_MACRO_DIR_TRACE' => 1,
'm4_pattern_forbid' => 1
}
], 'Autom4te::Request' ),
bless( [
'1',
1,
[
'/usr/share/autoconf'
],
[
'/usr/share/autoconf/autoconf/autoconf.m4f',
'aclocal.m4',
'configure.ac'
],
{
'_AM_COND_ELSE' => 1,
'AC_FC_FREEFORM' => 1,
'AC_CONFIG_AUX_DIR' => 1,
'AM_NLS' => 1,
'm4_pattern_forbid' => 1,
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
'AM_AUTOMAKE_VERSION' => 1,
'AC_LIBSOURCE' => 1,
'AM_GNU_GETTEXT' => 1,
'_LT_AC_TAGCONFIG' => 1,
'include' => 1,
'_AM_MAKEFILE_INCLUDE' => 1,
'AC_PROG_LIBTOOL' => 1,
'_AM_SUBST_NOTMAKE' => 1,
'AC_CONFIG_FILES' => 1,
'AM_PROG_MOC' => 1,
'AC_CONFIG_LINKS' => 1,
'LT_CONFIG_LTDL_DIR' => 1,
'AC_CANONICAL_SYSTEM' => 1,
'm4_pattern_allow' => 1,
'_AM_COND_ENDIF' => 1,
'AC_CANONICAL_HOST' => 1,
'AM_PROG_F77_C_O' => 1,
'sinclude' => 1,
'AC_CONFIG_HEADERS' => 1,
'AM_XGETTEXT_OPTION' => 1,
'AM_POT_TOOLS' => 1,
'AM_PROG_CXX_C_O' => 1,
'AM_INIT_AUTOMAKE' => 1,
'AM_PROG_LIBTOOL' => 1,
'AC_REQUIRE_AUX_FILE' => 1,
'm4_sinclude' => 1,
'AC_FC_PP_SRCEXT' => 1,
'AC_SUBST_TRACE' => 1,
'_AM_COND_IF' => 1,
'AC_FC_PP_DEFINE' => 1,
'_m4_warn' => 1,
'AC_CONFIG_SUBDIRS' => 1,
'AC_INIT' => 1,
'AM_CONDITIONAL' => 1,
'AC_SUBST' => 1,
'AC_CONFIG_LIBOBJ_DIR' => 1,
'AM_PROG_AR' => 1,
'm4_include' => 1,
'AM_MAKEFILE_INCLUDE' => 1,
'AM_MAINTAINER_MODE' => 1,
'AM_SILENT_RULES' => 1,
'AM_ENABLE_MULTILIB' => 1,
'AM_PROG_FC_C_O' => 1,
'AM_PATH_GUILE' => 1,
'LT_SUPPORTED_TAG' => 1,
'AC_CANONICAL_BUILD' => 1,
'AC_DEFINE_TRACE_LITERAL' => 1,
'AC_CANONICAL_TARGET' => 1,
'AH_OUTPUT' => 1,
'AC_FC_SRCEXT' => 1,
'AM_PROG_CC_C_O' => 1,
'LT_INIT' => 1
}
], 'Autom4te::Request' )
);

View File

@ -0,0 +1,70 @@
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:3: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:1857: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:3: the top level])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
m4trace:configure.ac:6: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
You should run autoupdate.], [])
m4trace:configure.ac:6: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:6: -1- m4_pattern_allow([^LTLIBOBJS$])

View File

@ -0,0 +1,437 @@
m4trace:configure.ac:2: -1- AC_INIT([aclocal.m4])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?A[CHUM]_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([_AC_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
m4trace:configure.ac:2: -1- m4_pattern_allow([^AS_FLAGS$])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?m4_])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^dnl$])
m4trace:configure.ac:2: -1- m4_pattern_forbid([^_?AS_])
m4trace:configure.ac:2: -1- AC_SUBST([SHELL])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([SHELL])
m4trace:configure.ac:2: -1- m4_pattern_allow([^SHELL$])
m4trace:configure.ac:2: -1- AC_SUBST([PATH_SEPARATOR])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PATH_SEPARATOR])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PATH_SEPARATOR$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_NAME])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_TARNAME])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_VERSION])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_STRING])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:2: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([PACKAGE_URL])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:2: -1- AC_SUBST([exec_prefix], [NONE])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([exec_prefix])
m4trace:configure.ac:2: -1- m4_pattern_allow([^exec_prefix$])
m4trace:configure.ac:2: -1- AC_SUBST([prefix], [NONE])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([prefix])
m4trace:configure.ac:2: -1- m4_pattern_allow([^prefix$])
m4trace:configure.ac:2: -1- AC_SUBST([program_transform_name], [s,x,x,])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([program_transform_name])
m4trace:configure.ac:2: -1- m4_pattern_allow([^program_transform_name$])
m4trace:configure.ac:2: -1- AC_SUBST([bindir], ['${exec_prefix}/bin'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([bindir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^bindir$])
m4trace:configure.ac:2: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sbindir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sbindir$])
m4trace:configure.ac:2: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libexecdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^libexecdir$])
m4trace:configure.ac:2: -1- AC_SUBST([datarootdir], ['${prefix}/share'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datarootdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^datarootdir$])
m4trace:configure.ac:2: -1- AC_SUBST([datadir], ['${datarootdir}'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([datadir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^datadir$])
m4trace:configure.ac:2: -1- AC_SUBST([sysconfdir], ['${prefix}/etc'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sysconfdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sysconfdir$])
m4trace:configure.ac:2: -1- AC_SUBST([sharedstatedir], ['${prefix}/com'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([sharedstatedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^sharedstatedir$])
m4trace:configure.ac:2: -1- AC_SUBST([localstatedir], ['${prefix}/var'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localstatedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^localstatedir$])
m4trace:configure.ac:2: -1- AC_SUBST([includedir], ['${prefix}/include'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([includedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^includedir$])
m4trace:configure.ac:2: -1- AC_SUBST([oldincludedir], ['/usr/include'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([oldincludedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^oldincludedir$])
m4trace:configure.ac:2: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
['${datarootdir}/doc/${PACKAGE_TARNAME}'],
['${datarootdir}/doc/${PACKAGE}'])])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([docdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^docdir$])
m4trace:configure.ac:2: -1- AC_SUBST([infodir], ['${datarootdir}/info'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([infodir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^infodir$])
m4trace:configure.ac:2: -1- AC_SUBST([htmldir], ['${docdir}'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([htmldir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^htmldir$])
m4trace:configure.ac:2: -1- AC_SUBST([dvidir], ['${docdir}'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([dvidir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^dvidir$])
m4trace:configure.ac:2: -1- AC_SUBST([pdfdir], ['${docdir}'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([pdfdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^pdfdir$])
m4trace:configure.ac:2: -1- AC_SUBST([psdir], ['${docdir}'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([psdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^psdir$])
m4trace:configure.ac:2: -1- AC_SUBST([libdir], ['${exec_prefix}/lib'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([libdir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^libdir$])
m4trace:configure.ac:2: -1- AC_SUBST([localedir], ['${datarootdir}/locale'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([localedir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^localedir$])
m4trace:configure.ac:2: -1- AC_SUBST([mandir], ['${datarootdir}/man'])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([mandir])
m4trace:configure.ac:2: -1- m4_pattern_allow([^mandir$])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_NAME$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */
@%:@undef PACKAGE_NAME])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_TARNAME$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */
@%:@undef PACKAGE_TARNAME])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_VERSION$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */
@%:@undef PACKAGE_VERSION])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_STRING$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */
@%:@undef PACKAGE_STRING])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */
@%:@undef PACKAGE_BUGREPORT])
m4trace:configure.ac:2: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL])
m4trace:configure.ac:2: -1- m4_pattern_allow([^PACKAGE_URL$])
m4trace:configure.ac:2: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */
@%:@undef PACKAGE_URL])
m4trace:configure.ac:2: -1- AC_SUBST([DEFS])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([DEFS])
m4trace:configure.ac:2: -1- m4_pattern_allow([^DEFS$])
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_C])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_C])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_C$])
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_N])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_N])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_N$])
m4trace:configure.ac:2: -1- AC_SUBST([ECHO_T])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([ECHO_T])
m4trace:configure.ac:2: -1- m4_pattern_allow([^ECHO_T$])
m4trace:configure.ac:2: -1- AC_SUBST([LIBS])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:2: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:2: -1- AC_SUBST([build_alias])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([build_alias])
m4trace:configure.ac:2: -1- m4_pattern_allow([^build_alias$])
m4trace:configure.ac:2: -1- AC_SUBST([host_alias])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([host_alias])
m4trace:configure.ac:2: -1- m4_pattern_allow([^host_alias$])
m4trace:configure.ac:2: -1- AC_SUBST([target_alias])
m4trace:configure.ac:2: -1- AC_SUBST_TRACE([target_alias])
m4trace:configure.ac:2: -1- m4_pattern_allow([^target_alias$])
m4trace:configure.ac:3: -1- AC_CANONICAL_SYSTEM
m4trace:configure.ac:3: -1- _m4_warn([obsolete], [The macro `AC_CANONICAL_SYSTEM' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:1857: AC_CANONICAL_SYSTEM is expanded from...
configure.ac:3: the top level])
m4trace:configure.ac:3: -1- AC_CANONICAL_TARGET
m4trace:configure.ac:3: -1- AC_CANONICAL_HOST
m4trace:configure.ac:3: -1- AC_CANONICAL_BUILD
m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.sub])
m4trace:configure.ac:3: -1- AC_REQUIRE_AUX_FILE([config.guess])
m4trace:configure.ac:3: -1- AC_SUBST([build], [$ac_cv_build])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build$])
m4trace:configure.ac:3: -1- AC_SUBST([build_cpu], [$[1]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_cpu])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_cpu$])
m4trace:configure.ac:3: -1- AC_SUBST([build_vendor], [$[2]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_vendor])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_vendor$])
m4trace:configure.ac:3: -1- AC_SUBST([build_os])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([build_os])
m4trace:configure.ac:3: -1- m4_pattern_allow([^build_os$])
m4trace:configure.ac:3: -1- AC_SUBST([host], [$ac_cv_host])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host$])
m4trace:configure.ac:3: -1- AC_SUBST([host_cpu], [$[1]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_cpu])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_cpu$])
m4trace:configure.ac:3: -1- AC_SUBST([host_vendor], [$[2]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_vendor])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_vendor$])
m4trace:configure.ac:3: -1- AC_SUBST([host_os])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([host_os])
m4trace:configure.ac:3: -1- m4_pattern_allow([^host_os$])
m4trace:configure.ac:3: -1- AC_SUBST([target], [$ac_cv_target])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target$])
m4trace:configure.ac:3: -1- AC_SUBST([target_cpu], [$[1]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_cpu])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_cpu$])
m4trace:configure.ac:3: -1- AC_SUBST([target_vendor], [$[2]])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_vendor])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_vendor$])
m4trace:configure.ac:3: -1- AC_SUBST([target_os])
m4trace:configure.ac:3: -1- AC_SUBST_TRACE([target_os])
m4trace:configure.ac:3: -1- m4_pattern_allow([^target_os$])
m4trace:configure.ac:5: -1- AC_SUBST([RANLIB])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([RANLIB])
m4trace:configure.ac:5: -1- m4_pattern_allow([^RANLIB$])
m4trace:configure.ac:5: -1- AC_REQUIRE_AUX_FILE([install-sh])
m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_PROGRAM])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_PROGRAM])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_PROGRAM$])
m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_SCRIPT])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_SCRIPT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_SCRIPT$])
m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_DATA])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_DATA])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_DATA$])
m4trace:configure.ac:5: -1- AC_SUBST([LN_S], [$as_ln_s])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LN_S])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LN_S$])
m4trace:configure.ac:5: -1- AC_SUBST([SET_MAKE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SET_MAKE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SET_MAKE$])
m4trace:configure.ac:5: -1- AC_SUBST([MAKE_SET])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([MAKE_SET])
m4trace:configure.ac:5: -1- m4_pattern_allow([^MAKE_SET$])
m4trace:configure.ac:5: -1- AC_SUBST([AR])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:5: -1- AC_SUBST([AR])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:5: -1- AC_SUBST([AR])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AR])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AR$])
m4trace:configure.ac:5: -1- AC_SUBST([AROPTIONS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AROPTIONS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AROPTIONS$])
m4trace:configure.ac:5: -1- AC_SUBST([STRIP])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([STRIP])
m4trace:configure.ac:5: -1- m4_pattern_allow([^STRIP$])
m4trace:configure.ac:5: -1- AC_SUBST([NM])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([NM])
m4trace:configure.ac:5: -1- m4_pattern_allow([^NM$])
m4trace:configure.ac:5: -1- AC_SUBST([INSTALL_DIR])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([INSTALL_DIR])
m4trace:configure.ac:5: -1- m4_pattern_allow([^INSTALL_DIR$])
m4trace:configure.ac:5: -1- AC_SUBST([LDFLAGS_GUI])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LDFLAGS_GUI])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LDFLAGS_GUI$])
m4trace:configure.ac:5: -1- AC_SUBST([IF_GNU_MAKE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([IF_GNU_MAKE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^IF_GNU_MAKE$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_UNIX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_UNIX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_UNIX$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_WIN32])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_WIN32])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_WIN32$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MSDOS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MSDOS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MSDOS$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MAC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MAC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MAC$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MACOS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MACOS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MACOS$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_MACOSX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_MACOSX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_MACOSX$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_OS2])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_OS2])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_OS2$])
m4trace:configure.ac:5: -1- AC_SUBST([PLATFORM_BEOS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PLATFORM_BEOS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PLATFORM_BEOS$])
m4trace:configure.ac:5: -1- AC_SUBST([SO_SUFFIX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SO_SUFFIX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SO_SUFFIX$])
m4trace:configure.ac:5: -1- AC_SUBST([SO_SUFFIX_MODULE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SO_SUFFIX_MODULE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SO_SUFFIX_MODULE$])
m4trace:configure.ac:5: -1- AC_SUBST([DLLIMP_SUFFIX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLIMP_SUFFIX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLIMP_SUFFIX$])
m4trace:configure.ac:5: -1- AC_SUBST([EXEEXT])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:5: -1- AC_SUBST([LIBPREFIX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBPREFIX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBPREFIX$])
m4trace:configure.ac:5: -1- AC_SUBST([LIBEXT])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBEXT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBEXT$])
m4trace:configure.ac:5: -1- AC_SUBST([DLLPREFIX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLPREFIX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLPREFIX$])
m4trace:configure.ac:5: -1- AC_SUBST([DLLPREFIX_MODULE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DLLPREFIX_MODULE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^DLLPREFIX_MODULE$])
m4trace:configure.ac:5: -1- AC_SUBST([dlldir])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([dlldir])
m4trace:configure.ac:5: -1- m4_pattern_allow([^dlldir$])
m4trace:configure.ac:5: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
aclocal.m4:780: AC_BAKEFILE_SHARED_LD is expanded from...
aclocal.m4:1299: AC_BAKEFILE is expanded from...
configure.ac:5: the top level])
m4trace:configure.ac:5: -1- AC_SUBST([CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:5: -1- AC_SUBST([CFLAGS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CFLAGS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CFLAGS$])
m4trace:configure.ac:5: -1- AC_SUBST([LDFLAGS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LDFLAGS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LDFLAGS$])
m4trace:configure.ac:5: -1- AC_SUBST([LIBS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([LIBS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^LIBS$])
m4trace:configure.ac:5: -1- AC_SUBST([CPPFLAGS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CPPFLAGS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CPPFLAGS$])
m4trace:configure.ac:5: -1- AC_SUBST([CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:5: -1- AC_SUBST([CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:5: -1- AC_SUBST([CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:5: -1- AC_SUBST([CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^CC$])
m4trace:configure.ac:5: -1- AC_SUBST([ac_ct_CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([ac_ct_CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^ac_ct_CC$])
m4trace:configure.ac:5: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([EXEEXT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^EXEEXT$])
m4trace:configure.ac:5: -1- AC_SUBST([OBJEXT], [$ac_cv_objext])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([OBJEXT])
m4trace:configure.ac:5: -1- m4_pattern_allow([^OBJEXT$])
m4trace:configure.ac:5: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete.
You should run autoupdate.], [../../lib/autoconf/general.m4:2614: AC_TRY_COMPILE is expanded from...
../../lib/m4sugar/m4sh.m4:639: AS_IF is expanded from...
../../lib/autoconf/general.m4:2031: AC_CACHE_VAL is expanded from...
../../lib/autoconf/general.m4:2052: AC_CACHE_CHECK is expanded from...
aclocal.m4:780: AC_BAKEFILE_SHARED_LD is expanded from...
aclocal.m4:1299: AC_BAKEFILE is expanded from...
configure.ac:5: the top level])
m4trace:configure.ac:5: -1- AC_SUBST([AIX_CXX_LD])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([AIX_CXX_LD])
m4trace:configure.ac:5: -1- m4_pattern_allow([^AIX_CXX_LD$])
m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_CC$])
m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_CXX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_CXX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_CXX$])
m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_MODULE_CC])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_MODULE_CC])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_MODULE_CC$])
m4trace:configure.ac:5: -1- AC_SUBST([SHARED_LD_MODULE_CXX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SHARED_LD_MODULE_CXX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SHARED_LD_MODULE_CXX$])
m4trace:configure.ac:5: -1- AC_SUBST([PIC_FLAG])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([PIC_FLAG])
m4trace:configure.ac:5: -1- m4_pattern_allow([^PIC_FLAG$])
m4trace:configure.ac:5: -1- AC_SUBST([WINDOWS_IMPLIB])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDOWS_IMPLIB])
m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDOWS_IMPLIB$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERSION])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERSION])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERSION$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERLINUX])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERLINUX])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERLINUX$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERSOLARIS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERSOLARIS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERSOLARIS$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_SOVERCYGWIN])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOVERCYGWIN])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOVERCYGWIN$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_MACVERSION])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_MACVERSION])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_MACVERSION$])
m4trace:configure.ac:5: -1- AC_SUBST([USE_SOSYMLINKS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([USE_SOSYMLINKS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^USE_SOSYMLINKS$])
m4trace:configure.ac:5: -1- AC_SUBST([SONAME_FLAG])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SONAME_FLAG])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SONAME_FLAG$])
m4trace:configure.ac:5: -1- AC_SUBST([DEPS_TRACKING])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([DEPS_TRACKING])
m4trace:configure.ac:5: -1- m4_pattern_allow([^DEPS_TRACKING$])
m4trace:configure.ac:5: -1- AC_SUBST([BK_DEPS])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([BK_DEPS])
m4trace:configure.ac:5: -1- m4_pattern_allow([^BK_DEPS$])
m4trace:configure.ac:5: -1- AC_SUBST([WINDRES])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDRES])
m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDRES$])
m4trace:configure.ac:5: -1- AC_SUBST([REZ])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([REZ])
m4trace:configure.ac:5: -1- m4_pattern_allow([^REZ$])
m4trace:configure.ac:5: -1- AC_SUBST([SETFILE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SETFILE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SETFILE$])
m4trace:configure.ac:5: -1- AC_SUBST([WINDRES])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([WINDRES])
m4trace:configure.ac:5: -1- m4_pattern_allow([^WINDRES$])
m4trace:configure.ac:5: -1- AC_SUBST([REZ])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([REZ])
m4trace:configure.ac:5: -1- m4_pattern_allow([^REZ$])
m4trace:configure.ac:5: -1- AC_SUBST([SETFILE])
m4trace:configure.ac:5: -1- AC_SUBST_TRACE([SETFILE])
m4trace:configure.ac:5: -1- m4_pattern_allow([^SETFILE$])
m4trace:configure.ac:5: -1- m4_include([autoconf_inc.m4])
m4trace:autoconf_inc.m4:14: -1- AC_SUBST([COND_DEPS_TRACKING_0])
m4trace:autoconf_inc.m4:14: -1- AC_SUBST_TRACE([COND_DEPS_TRACKING_0])
m4trace:autoconf_inc.m4:14: -1- m4_pattern_allow([^COND_DEPS_TRACKING_0$])
m4trace:autoconf_inc.m4:20: -1- AC_SUBST([COND_DEPS_TRACKING_1])
m4trace:autoconf_inc.m4:20: -1- AC_SUBST_TRACE([COND_DEPS_TRACKING_1])
m4trace:autoconf_inc.m4:20: -1- m4_pattern_allow([^COND_DEPS_TRACKING_1$])
m4trace:configure.ac:6: -1- AC_CONFIG_FILES([Makefile])
m4trace:configure.ac:6: -1- _m4_warn([obsolete], [AC_OUTPUT should be used without arguments.
You should run autoupdate.], [])
m4trace:configure.ac:6: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIB@&t@OBJS])
m4trace:configure.ac:6: -1- m4_pattern_allow([^LIB@&t@OBJS$])
m4trace:configure.ac:6: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LTLIBOBJS])
m4trace:configure.ac:6: -1- m4_pattern_allow([^LTLIBOBJS$])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_builddir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_build_prefix])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([srcdir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_srcdir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([top_srcdir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_top_srcdir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([builddir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_builddir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([abs_top_builddir])
m4trace:configure.ac:6: -1- AC_SUBST_TRACE([INSTALL])

View File

@ -0,0 +1,25 @@
<?xml version="1.0"?>
<makefile>
<set var="SRCDIR">../../source</set>
<set var="BUILDDIR">../../bin</set>
<set var="CXX">gcc</set>
<module id="bcrypt">
<include>../../source/include</include>
<headers>
include/bcrypt.h
</headers>
<sources>
src/bcrypt.c
src/blowfish.c
src/endian.c
src/keys.c
src/rwfile.c
src/wrapbf.c
src/wrapzl.c
</sources>
<install-to>/usr/local/lib</install-to>
<install-headers-to>/usr/local/include/bcrypt</install-headers-to>
</module>
</makefile>

99
3rdparty/libbcrypt-1.0/build/unix/bk-deps vendored Executable file
View File

@ -0,0 +1,99 @@
#!/bin/sh
# This script is part of Bakefile (http://bakefile.sourceforge.net) autoconf
# script. It is used to track C/C++ files dependencies in portable way.
#
# Permission is given to use this file in any way.
DEPSMODE=gcc
DEPSDIR=.deps
DEPSFLAG="-MMD"
mkdir -p $DEPSDIR
if test $DEPSMODE = gcc ; then
$* ${DEPSFLAG}
status=$?
if test ${status} != 0 ; then
exit ${status}
fi
# move created file to the location we want it in:
while test $# -gt 0; do
case "$1" in
-o )
shift
objfile=$1
;;
-* )
;;
* )
srcfile=$1
;;
esac
shift
done
depfile=`basename $srcfile | sed -e 's/\..*$/.d/g'`
depobjname=`echo $depfile |sed -e 's/\.d/.o/g'`
if test -f $depfile ; then
sed -e "s,$depobjname:,$objfile:,g" $depfile >${DEPSDIR}/${objfile}.d
rm -f $depfile
else
# "g++ -MMD -o fooobj.o foosrc.cpp" produces fooobj.d
depfile=`basename $objfile | sed -e 's/\..*$/.d/g'`
if test ! -f $depfile ; then
# "cxx -MD -o fooobj.o foosrc.cpp" creates fooobj.o.d (Compaq C++)
depfile="$objfile.d"
fi
if test -f $depfile ; then
sed -e "/^$objfile/!s,$depobjname:,$objfile:,g" $depfile >${DEPSDIR}/${objfile}.d
rm -f $depfile
fi
fi
exit 0
elif test $DEPSMODE = mwcc ; then
$* || exit $?
# Run mwcc again with -MM and redirect into the dep file we want
# NOTE: We can't use shift here because we need $* to be valid
prevarg=
for arg in $* ; do
if test "$prevarg" = "-o"; then
objfile=$arg
else
case "$arg" in
-* )
;;
* )
srcfile=$arg
;;
esac
fi
prevarg="$arg"
done
$* $DEPSFLAG >${DEPSDIR}/${objfile}.d
exit 0
elif test $DEPSMODE = unixcc; then
$* || exit $?
# Run compiler again with deps flag and redirect into the dep file.
# It doesn't work if the '-o FILE' option is used, but without it the
# dependency file will contain the wrong name for the object. So it is
# removed from the command line, and the dep file is fixed with sed.
cmd=""
while test $# -gt 0; do
case "$1" in
-o )
shift
objfile=$1
;;
* )
eval arg$#=\$1
cmd="$cmd \$arg$#"
;;
esac
shift
done
eval "$cmd $DEPSFLAG" | sed "s|.*:|$objfile:|" >${DEPSDIR}/${objfile}.d
exit 0
else
$*
exit $?
fi

1497
3rdparty/libbcrypt-1.0/build/unix/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,321 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = agalloch
uname -m = x86_64
uname -r = 3.19.0-26-generic
uname -s = Linux
uname -v = #28-Ubuntu SMP Tue Aug 11 14:16:32 UTC 2015
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/eric/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /usr/lib/jvm/java-7-openjdk-amd64/jre//bin
PATH: /usr/lib/jvm/java-7-openjdk-amd64/jre//bin
PATH: /usr/local/lib
PATH: /home/eric/android-studio/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1837: checking build system type
configure:1851: result: x86_64-unknown-linux-gnu
configure:1871: checking host system type
configure:1884: result: x86_64-unknown-linux-gnu
configure:1904: checking target system type
configure:1917: result: x86_64-unknown-linux-gnu
configure:1959: checking for a BSD-compatible install
configure:2027: result: /usr/bin/install -c
configure:2086: checking for gcc
configure:2102: found /usr/bin/gcc
configure:2113: result: gcc
configure:2342: checking for C compiler version
configure:2351: gcc --version >&5
gcc-4.9.real (Ubuntu 4.9.2-10ubuntu13) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2362: $? = 0
configure:2351: gcc -v >&5
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc-4.9.real
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
configure:2362: $? = 0
configure:2351: gcc -V >&5
gcc-4.9.real: error: unrecognized command line option '-V'
gcc-4.9.real: fatal error: no input files
compilation terminated.
configure:2362: $? = 4
configure:2351: gcc -qversion >&5
gcc-4.9.real: error: unrecognized command line option '-qversion'
gcc-4.9.real: fatal error: no input files
compilation terminated.
configure:2362: $? = 4
configure:2382: checking whether the C compiler works
configure:2404: gcc conftest.c >&5
configure:2408: $? = 0
configure:2456: result: yes
configure:2459: checking for C compiler default output file name
configure:2461: result: a.out
configure:2467: checking for suffix of executables
configure:2474: gcc -o conftest conftest.c >&5
configure:2478: $? = 0
configure:2500: result:
configure:2522: checking whether we are cross compiling
configure:2530: gcc -o conftest conftest.c >&5
configure:2534: $? = 0
configure:2541: ./conftest
configure:2545: $? = 0
configure:2560: result: no
configure:2565: checking for suffix of object files
configure:2587: gcc -c conftest.c >&5
configure:2591: $? = 0
configure:2612: result: o
configure:2616: checking whether we are using the GNU C compiler
configure:2635: gcc -c conftest.c >&5
configure:2635: $? = 0
configure:2644: result: yes
configure:2653: checking whether gcc accepts -g
configure:2673: gcc -c -g conftest.c >&5
configure:2673: $? = 0
configure:2714: result: yes
configure:2731: checking for gcc option to accept ISO C89
configure:2794: gcc -c -g -O2 conftest.c >&5
configure:2794: $? = 0
configure:2807: result: none needed
configure:2884: checking for ranlib
configure:2900: found /usr/bin/ranlib
configure:2911: result: ranlib
configure:2934: checking whether ln -s works
configure:2938: result: yes
configure:2946: checking whether make sets $(MAKE)
configure:2968: result: yes
configure:3031: checking for ar
configure:3047: found /usr/bin/ar
configure:3058: result: ar
configure:3127: checking for strip
configure:3143: found /usr/bin/strip
configure:3154: result: strip
configure:3219: checking for nm
configure:3235: found /usr/bin/nm
configure:3246: result: nm
configure:3288: checking if make is GNU make
configure:3302: result: yes
configure:4358: checking for dependency tracking method
configure:4379: result: gcc
configure:4884: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on agalloch
config.status:782: creating Makefile
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_NM=nm
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_prog_make_make_set=yes
ac_cv_target=x86_64-unknown-linux-gnu
bakefile_cv_prog_makeisgnu=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
AIX_CXX_LD=''
AR='ar'
AROPTIONS='rcu'
BK_DEPS='/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps'
CC='gcc'
CFLAGS='-g -O2'
COND_DEPS_TRACKING_0='#'
COND_DEPS_TRACKING_1=''
CPPFLAGS=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\"'
DEPS_TRACKING='1'
DLLIMP_SUFFIX='so'
DLLPREFIX='lib'
DLLPREFIX_MODULE=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
IF_GNU_MAKE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_DIR='$(INSTALL) -d'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDFLAGS=''
LDFLAGS_GUI=''
LIBEXT='.a'
LIBOBJS=''
LIBPREFIX='lib'
LIBS=''
LN_S='ln -s'
LTLIBOBJS=''
MAKE_SET=''
NM='nm'
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PIC_FLAG='-fPIC -DPIC'
PLATFORM_BEOS='0'
PLATFORM_MAC='0'
PLATFORM_MACOS='0'
PLATFORM_MACOSX='0'
PLATFORM_MSDOS='0'
PLATFORM_OS2='0'
PLATFORM_UNIX='1'
PLATFORM_WIN32='0'
RANLIB='ranlib'
REZ=''
SETFILE=''
SET_MAKE=''
SHARED_LD_CC='$(CC) -shared -fPIC -o'
SHARED_LD_CXX='$(CXX) -shared -fPIC -o'
SHARED_LD_MODULE_CC='$(CC) -shared -fPIC -o'
SHARED_LD_MODULE_CXX='$(CXX) -shared -fPIC -o'
SHELL='/bin/bash'
SONAME_FLAG='-Wl,-soname,'
SO_SUFFIX='so'
SO_SUFFIX_MODULE='so'
STRIP='strip'
USE_MACVERSION='0'
USE_SOSYMLINKS='1'
USE_SOVERCYGWIN='0'
USE_SOVERLINUX='1'
USE_SOVERSION='1'
USE_SOVERSOLARIS='0'
WINDOWS_IMPLIB='0'
WINDRES=''
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
dlldir='${exec_prefix}/lib'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='x86_64-unknown-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='unknown'
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
configure: exit 0

View File

@ -0,0 +1,954 @@
#! /bin/bash
# Generated by configure.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=${CONFIG_SHELL-/bin/bash}
export SHELL
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by $as_me, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
# Files that config.status was made for.
config_files=" Makefile"
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
Report bugs to the package provider."
ac_cs_config=""
ac_cs_version="\
config.status
configured by ./configure, generated by GNU Autoconf 2.69,
with options \"$ac_cs_config\"
Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix'
srcdir='.'
INSTALL='/usr/bin/install -c'
test -n "$AWK" || AWK=awk
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
if $ac_cs_recheck; then
set X /bin/bash './configure' $ac_configure_extra_args --no-create --no-recursion
shift
$as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
CONFIG_SHELL='/bin/bash'
export CONFIG_SHELL
exec "$@"
fi
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
cat >>"$ac_tmp/subs1.awk" <<\_ACAWK &&
S["LTLIBOBJS"]=""
S["LIBOBJS"]=""
S["COND_DEPS_TRACKING_1"]=""
S["COND_DEPS_TRACKING_0"]="#"
S["SETFILE"]=""
S["REZ"]=""
S["WINDRES"]=""
S["BK_DEPS"]="/home/eric/code/hathor/3rdparty/libbcrypt-1.0/build/unix/bk-deps"
S["DEPS_TRACKING"]="1"
S["SONAME_FLAG"]="-Wl,-soname,"
S["USE_SOSYMLINKS"]="1"
S["USE_MACVERSION"]="0"
S["USE_SOVERCYGWIN"]="0"
S["USE_SOVERSOLARIS"]="0"
S["USE_SOVERLINUX"]="1"
S["USE_SOVERSION"]="1"
S["WINDOWS_IMPLIB"]="0"
S["PIC_FLAG"]="-fPIC -DPIC"
S["SHARED_LD_MODULE_CXX"]="$(CXX) -shared -fPIC -o"
S["SHARED_LD_MODULE_CC"]="$(CC) -shared -fPIC -o"
S["SHARED_LD_CXX"]="$(CXX) -shared -fPIC -o"
S["SHARED_LD_CC"]="$(CC) -shared -fPIC -o"
S["AIX_CXX_LD"]=""
S["OBJEXT"]="o"
S["ac_ct_CC"]="gcc"
S["CPPFLAGS"]=""
S["LDFLAGS"]=""
S["CFLAGS"]="-g -O2"
S["CC"]="gcc"
S["dlldir"]="${exec_prefix}/lib"
S["DLLPREFIX_MODULE"]=""
S["DLLPREFIX"]="lib"
S["LIBEXT"]=".a"
S["LIBPREFIX"]="lib"
S["EXEEXT"]=""
S["DLLIMP_SUFFIX"]="so"
S["SO_SUFFIX_MODULE"]="so"
S["SO_SUFFIX"]="so"
S["PLATFORM_BEOS"]="0"
S["PLATFORM_OS2"]="0"
S["PLATFORM_MACOSX"]="0"
S["PLATFORM_MACOS"]="0"
S["PLATFORM_MAC"]="0"
S["PLATFORM_MSDOS"]="0"
S["PLATFORM_WIN32"]="0"
S["PLATFORM_UNIX"]="1"
S["IF_GNU_MAKE"]=""
S["LDFLAGS_GUI"]=""
S["INSTALL_DIR"]="$(INSTALL) -d"
S["NM"]="nm"
S["STRIP"]="strip"
S["AROPTIONS"]="rcu"
S["AR"]="ar"
S["MAKE_SET"]=""
S["SET_MAKE"]=""
S["LN_S"]="ln -s"
S["INSTALL_DATA"]="${INSTALL} -m 644"
S["INSTALL_SCRIPT"]="${INSTALL}"
S["INSTALL_PROGRAM"]="${INSTALL}"
S["RANLIB"]="ranlib"
S["target_os"]="linux-gnu"
S["target_vendor"]="unknown"
S["target_cpu"]="x86_64"
S["target"]="x86_64-unknown-linux-gnu"
S["host_os"]="linux-gnu"
S["host_vendor"]="unknown"
S["host_cpu"]="x86_64"
S["host"]="x86_64-unknown-linux-gnu"
S["build_os"]="linux-gnu"
S["build_vendor"]="unknown"
S["build_cpu"]="x86_64"
S["build"]="x86_64-unknown-linux-gnu"
S["target_alias"]=""
S["host_alias"]=""
S["build_alias"]=""
S["LIBS"]=""
S["ECHO_T"]=""
S["ECHO_N"]="-n"
S["ECHO_C"]=""
S["DEFS"]="-DPACKAGE_NAME=\\\"\\\" -DPACKAGE_TARNAME=\\\"\\\" -DPACKAGE_VERSION=\\\"\\\" -DPACKAGE_STRING=\\\"\\\" -DPACKAGE_BUGREPORT=\\\"\\\" -DPACKAGE_URL=\\\"\\\""
S["mandir"]="${datarootdir}/man"
S["localedir"]="${datarootdir}/locale"
S["libdir"]="${exec_prefix}/lib"
S["psdir"]="${docdir}"
S["pdfdir"]="${docdir}"
S["dvidir"]="${docdir}"
S["htmldir"]="${docdir}"
S["infodir"]="${datarootdir}/info"
S["docdir"]="${datarootdir}/doc/${PACKAGE}"
S["oldincludedir"]="/usr/include"
S["includedir"]="${prefix}/include"
S["localstatedir"]="${prefix}/var"
S["sharedstatedir"]="${prefix}/com"
S["sysconfdir"]="${prefix}/etc"
S["datadir"]="${datarootdir}"
S["datarootdir"]="${prefix}/share"
S["libexecdir"]="${exec_prefix}/libexec"
S["sbindir"]="${exec_prefix}/sbin"
S["bindir"]="${exec_prefix}/bin"
S["program_transform_name"]="s,x,x,"
S["prefix"]="/usr/local"
S["exec_prefix"]="${prefix}"
S["PACKAGE_URL"]=""
S["PACKAGE_BUGREPORT"]=""
S["PACKAGE_STRING"]=""
S["PACKAGE_VERSION"]=""
S["PACKAGE_TARNAME"]=""
S["PACKAGE_NAME"]=""
S["PATH_SEPARATOR"]=":"
S["SHELL"]="/bin/bash"
_ACAWK
cat >>"$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
fi # test -n "$CONFIG_FILES"
eval set X " :F $CONFIG_FILES "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
ac_datarootdir_hack='
s&@datadir@&${datarootdir}&g
s&@docdir@&${datarootdir}/doc/${PACKAGE}&g
s&@infodir@&${datarootdir}/info&g
s&@localedir@&${datarootdir}/locale&g
s&@mandir@&${datarootdir}/man&g
s&\${datarootdir}&${prefix}/share&g' ;;
esac
ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
esac
done # for ac_tag
as_fn_exit 0

1608
3rdparty/libbcrypt-1.0/build/unix/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

5895
3rdparty/libbcrypt-1.0/build/unix/configure vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
AC_PREREQ(2.53)
AC_INIT(aclocal.m4)
AC_CANONICAL_SYSTEM
DEBUG=0
AC_BAKEFILE([m4_include(autoconf_inc.m4)])
AC_OUTPUT([Makefile])

269
3rdparty/libbcrypt-1.0/build/unix/install-sh vendored Executable file
View File

@ -0,0 +1,269 @@
#!/bin/sh
#
# install - install a program, script, or datafile
#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View File

@ -0,0 +1 @@
test

112
3rdparty/libbcrypt-1.0/doc/bcrypt.readme vendored Normal file
View File

@ -0,0 +1,112 @@
ABOUT
--
Bcrypt is a cross platform file encryption utility. Encrypted files are
portable across all supported operating systems and processors. Passphrases
are between 8 and 56 characters and are hashed internally to a 448 bit
key. However, all characters supplied are significant. The stronger your
passphrase, the more secure your data.
Bcrypt uses the blowfish encryption algorithm published by Bruce Schneier
in 1993. More information on the algorithm can be found at:
http://www.counterpane.com/blowfish.html
Specifically, bcrypt uses Paul Kocher's implementation of the algorithm.
The source distributed with bcrypt has been slightly altered from the
original. Original source code can be obtained from:
http://www.counterpane.com/bfsh-koc.zip
SUPPORTED PLATFORMS
--
Bcrypt has been successfully tested on the following platforms:
x86
FreeBSD, OpenBSD, Linux, Cygwin, Win32
Sparc R220
Solaris 2.7, 2.8
Sparc Ultra60
Linux 2.4
Alpha
Linux 2.4
PPC G4
MacOS X 10.1 SERVER
PPC RS/6000
Linux 2.4
No other operating systems have been tested, but most should work with
minimal modifications. If you get bcrypt to compile without errors on any
other platform / architecture, I'd like to know about it. If patches are
necessary to get bcrypt work on your OS, I will try to incorporate them
into the main distribution.
If you have a machine not listed above that is incapable of compiling
bcrypt and are willing to give me access to the machine, I will make an
attempt to port it to your OS.
SYSTEM REQUIREMENTS
--
zlib - http://www.gzip.org/zlib/
INSTALLATION
--
If you're so inclined, edit config.h and change the defaults to whatever
you think is appropriate for your needs. If you choose not to have
bcrypt remove input files after processing, or set SECUREDELETE to 0,
you are likely to have data on your hard drive that can be recovered
even after deletion.
All of these options can be set on the command line as well. When you're
satisfied with the default settings, simply type:
make
then su and type:
make install
It would be wise to test the installation on a few unimportant files
before encrypting anything you value and removing the only copy.
USAGE
--
bcrypt [-orc][-sN] file ...
Encrypted files will be saved with an extension of .bfe. Any files ending
in .bfe will be assumed to be encrypted with bcrypt and will attempt to
decrypt them. Any other input files will be encrypted. If more than one
type of file is given, bcrypt will process all files which are the same as
the first filetype given.
By default, bcrypt will compress input files before encryption, remove
input files after they are processed (assuming they are processed
successfully) and overwrite input files with random data to prevent data
recovery.
Passphrases may be between 8 and 56 characters. Regardless of the
passphrase size, the key is hashed internally to 448 bits - the largest
keysize supported by the blowfish algorithm. However, it is still wise to
use a strong passphrase.
OPTIONS
-o print output to standard out. Implies -r.
-c DO NOT compress files before encryption.
-r DO NOT remove input files after processing
-sN How many times to overwrite input files with random
data before processing. The default number of
overwrites is 3. Use -s0 to disable this feature.
No effect if -r is supplied.
The options o,c and r each have the opposite effects if the appropriate
settings are altered from the default in config.h. To determine what
effect each of these have, run bcrypt without any options.
Encrypted files should be compatible between most systems. Binary
compatibility has been tested for all systems listed above.
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/

View File

@ -0,0 +1,20 @@
/* ====================================================================
* Copyleft 2007 John Sennesael, donationcoder.com
*
* Permission is hereby granted to copy, modify and reproduce this work
* in binary or source form, and in commercial and non-commercial form,
* given that the following conditions are met:
*
* - Include the original bcrypt license (not libbcrypt) on which this
* library is based
*
* - Include this license text with your program our source code.
*
* - Do not claim you wrote this library.
*
*
* Please note that the original bcrypt license terms have priority over
* the libbcrypt license terms, therefore you should read that license as
* well.
*
*/

View File

@ -0,0 +1,25 @@
++++++++++++++++++++++++++++++++
| libbcrypt version 1.0 readme |
++++++++++++++++++++++++++++++++
Please see bcrypt.h for how to use this library.
It only includes 2 functions, one to encrypt and one to decrypt.
======================================================================
= =
= *nix build instructions: =
= =
= cd build/unix =
= ./configure =
= make =
= =
= 'make install' is still a bit bugish, don't use it. =
= copy bin/bcrypt.so to /usr/lib/libbcrypt.so =
= and copy source/include/bcrypt.h to /usr/include/bcrypt/bcrypt.h =
= manually for now. =
= =
= That's all. =
= =
======================================================================
Mail comments to gothic@donationcoders.com

View File

@ -0,0 +1,17 @@
/* ====================================================================
* Copyright (c) 2002 John Sennesael. All rights reserved.
*
* This header is part of a C library interface for bcrypt developed by
* donationcoder.com
* ====================================================================
*/
#ifndef BCRYPT_H_INCLUDE
#define BCRYPT_H_INCLUDE
/// Encrypts a file.
int bcrypt(char* filename,char* key,char delOrig);
/// Decrypts a file.
int bdecrypt(char* filename,char* key,char delOrig);
#endif

View File

@ -0,0 +1,21 @@
/*
* Author : Paul Kocher
* E-mail : pck@netcom.com
* Date : 1997
* Description: C implementation of the Blowfish algorithm.
*/
#define MAXKEYBYTES 56 /* 448 bits */
typedef struct {
uInt32 P[16 + 2];
uInt32 S[4][256];
} BLOWFISH_CTX;
void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen);
void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32
*xr);
void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32
*xr);

View File

@ -0,0 +1,22 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
/* All options are either 1 for true or 0 for false w/ the exception */
/* of SECUREDELETE which may be anything from 0 to 127. */
/* All options may be overridden on the command line. */
/* whether or not to compress files */
#define COMPRESS 1
/* send output to stdout */
#define STANDARDOUT 0
/* remove input files after processing */
#define REMOVE 1
/* how many times to overwrite input files before deleting */
#define SECUREDELETE 3

View File

@ -0,0 +1,27 @@
typedef struct _BCoptions {
unsigned char remove;
unsigned char standardout;
unsigned char compression;
unsigned char type;
uLong origsize;
unsigned char securedelete;
} BCoptions;
#define ENCRYPT 0
#define DECRYPT 1
#define endianBig ((unsigned char) 0x45)
#define endianLittle ((unsigned char) 0x54)
typedef unsigned int uInt32;
#ifdef WIN32 /* Win32 doesn't have random() or lstat */
#define random() rand()
#define initstate(x,y,z) srand(x)
#define lstat(x,y) stat(x,y)
#endif
#ifndef S_ISREG
#define S_ISREG(x) ( ((x)&S_IFMT)==S_IFREG )
#endif

View File

@ -0,0 +1,51 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "blowfish.h"
/* from wrapbf.c */
uLong BFEncrypt(char **input, char *key, uLong sz,
BCoptions *options);
uLong BFDecrypt(char **input, char *key, char *key2,
uLong sz, BCoptions *options);
/* from keys.c */
char * getkey(int type, char* TheKey);
void mutateKey(char **key, char **key2);
/* from rwfile.c */
int getremain(uLong sz, int dv);
uLong padInput(char **input, uLong sz);
uLong attachKey(char **input, char *key, uLong sz);
uLong readfile(char *infile, char **input, int type, char *key,
struct stat statbuf);
uLong writefile(char *outfile, char *output, uLong sz,
BCoptions options, struct stat statbuf);
int deletefile(char *file, BCoptions options, char *key, struct stat statbuf);
/* from wrapzl.c */
uLong docompress(char **input, uLong sz);
uLong douncompress(char **input, uLong sz, BCoptions options);
/* from main.c */
BCoptions initoptions(BCoptions options);
int usage(char *name);
int memerror();
int parseArgs(char delOrig, BCoptions *options);
int assignFiles(char *arg, char **infile, char **outfile, struct stat *statbuf,
BCoptions *options, char *key);
int main(int argc, char *argv[]);
/* from endian.c */
void getEndian(unsigned char **e);
uInt32 swapEndian(uInt32 value);
int testEndian(char *input);
int swapCompressed(char **input, uLong sz);

View File

@ -0,0 +1,23 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef WIN32 /* These libraries don't exist on Win32 */
#include <unistd.h>
#include <termios.h>
#include <sys/time.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <zlib.h>

View File

@ -0,0 +1,192 @@
/* ====================================================================
* Copyright (c) 2002 John Sennesael. All rights reserved.
*
* This header is part of a C library interface for bcrypt developed by
* donationcoder.com
* ====================================================================
*/
#include "bcrypt.h"
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
#include "config.h"
extern char *optarg;
extern int optind, optreset, opterr;
BCoptions initoptions(BCoptions options) {
options.remove = REMOVE;
options.standardout = STANDARDOUT;
options.compression = COMPRESS; /* leave this on by default */
options.type = 127;
options.origsize = 0;
options.securedelete = SECUREDELETE;
return options;
}
int usage(char *name) {
fprintf(stderr, "Usage is: %s -[orc][-sN] file1 file2..\n", name);
if (STANDARDOUT == 0)
fprintf(stderr, " -o Write output to standard out\n");
else
fprintf(stderr, " -o Don't write output to standard out\n");
if (REMOVE == 1)
fprintf(stderr, " -r Do NOT remove input files after processing\n");
else
fprintf(stderr, " -r Remove input files after processing\n");
if (COMPRESS == 1)
fprintf(stderr, " -c Do NOT compress files before encryption\n");
else
fprintf(stderr, " -c Compress files before encryption\n");
fprintf(stderr, " -sN How many times to overwrite input files with random\
data\n");
return 0;
}
int memerror() {
fprintf(stderr, "Can't allocate enough memory. Bailing out\n");
return -1;
}
int parseArgs(char delOrig, BCoptions *options)
{
signed char ch;
char *progname;
*options = initoptions(*options);
options->remove = delOrig;
options->standardout = 0;
options->compression = 1;
return 0;
}
int assignFiles(char *arg, char **infile, char **outfile, struct stat *statbuf, BCoptions *options, char *key)
{
if (lstat(arg, statbuf) < 0) return(1);
if (!S_ISREG(statbuf->st_mode)) return(1);
if ((*infile = realloc(*infile, strlen(arg) + 1)) == NULL) memerror();
memset(*infile, 0, strlen(arg) + 1);
strcpy(*infile, arg);
if ((*outfile = realloc(*outfile, strlen(arg) + 5)) == NULL) memerror();
memset(*outfile, 0, strlen(arg) + 5);
strcpy(*outfile, *infile);
if (strlen(*infile) > 4)
{
if ((memcmp(*infile+(strlen(*infile) - 4), ".bfe", 4) == 0) && ((!key) || (options->type == DECRYPT)))
{
memset(*outfile+(strlen(*infile) - 4), 0, 4);
options->type = DECRYPT;
}
else if ((!key) || (options->type == ENCRYPT))
{
if (memcmp(*infile+(strlen(*infile) - 4), ".bfe", 4) == 0) return -1 ;
strcat(*outfile, ".bfe");
options->type = ENCRYPT;
}
else
{
return -1;
}
}
else if ((!key) || (options->type == ENCRYPT))
{
strcat(*outfile, ".bfe");
options->type = ENCRYPT;
}
else
{
return -1;
}
return 0;
}
int docrypt(char encrypt,char* filename, char* TheKey, char delOrig)
{
uLong sz = 0;
char *input = NULL, *key = NULL, *key2 = NULL;
char *infile = NULL, *outfile = NULL;
struct stat statbuf;
BCoptions options;
parseArgs(delOrig, &options);
if (assignFiles(filename, &infile, &outfile, &statbuf, &options, key) != 0)
{
return -1; // file open error
}
if (!key)
{
key = getkey(options.type,TheKey);
mutateKey(&key, &key2);
}
if (!key)
{
return -2; // missing key error
}
sz = readfile(infile, &input, options.type, key, statbuf);
if ((options.type == DECRYPT) && (testEndian(input))) swapCompressed(&input, sz);
if ((options.compression == 1) && (options.type == ENCRYPT))
{
options.origsize = sz;
sz = docompress(&input, sz);
}
if (options.type == ENCRYPT)
{
sz = attachKey(&input, key, sz);
sz = padInput(&input, sz);
}
if (options.type == ENCRYPT)
{
sz = BFEncrypt(&input, key, sz, &options);
}
else if (options.type == DECRYPT)
{
if ((sz = BFDecrypt(&input, key, key2, sz, &options)) == 0)
{
return -3; // wrong key error
}
}
if ((options.compression == 1) && (options.type == DECRYPT))
{
sz = douncompress(&input, sz, options);
}
writefile(outfile, input, sz, options, statbuf);
if ((input = realloc(input, sizeof(char *))) == NULL)
{
return -4; // memory error
}
if (options.remove == 1) deletefile(infile, options, key, statbuf);
if (input != NULL) free(input);
if (!sz)
{
return -5; // no valid files found
}
return 0; // success.
}
// Encrypts a file.
int bcrypt(char* filename,char* key,char delOrig)
{
int MyReturn = docrypt(1,filename,key,delOrig);
return MyReturn;
}
// Decrypts a file.
int bdecrypt(char* filename,char* key,char delOrig)
{
int MyReturn = docrypt(0,filename,key,delOrig);
return MyReturn;
}

View File

@ -0,0 +1,399 @@
/*
* Author : Paul Kocher
* E-mail : pck@netcom.com
* Date : 1997
* Description: C implementation of the Blowfish algorithm.
*/
#include "includes.h"
#include "defines.h"
#include "blowfish.h"
#define N 16
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x);
static const uInt32 ORIG_P[16 + 2] = {
0x243F6A88L, 0x85A308D3L, 0x13198A2EL, 0x03707344L,
0xA4093822L, 0x299F31D0L, 0x082EFA98L, 0xEC4E6C89L,
0x452821E6L, 0x38D01377L, 0xBE5466CFL, 0x34E90C6CL,
0xC0AC29B7L, 0xC97C50DDL, 0x3F84D5B5L, 0xB5470917L,
0x9216D5D9L, 0x8979FB1BL
};
static const uInt32 ORIG_S[4][256] = {
{ 0xD1310BA6L, 0x98DFB5ACL, 0x2FFD72DBL, 0xD01ADFB7L,
0xB8E1AFEDL, 0x6A267E96L, 0xBA7C9045L, 0xF12C7F99L,
0x24A19947L, 0xB3916CF7L, 0x0801F2E2L, 0x858EFC16L,
0x636920D8L, 0x71574E69L, 0xA458FEA3L, 0xF4933D7EL,
0x0D95748FL, 0x728EB658L, 0x718BCD58L, 0x82154AEEL,
0x7B54A41DL, 0xC25A59B5L, 0x9C30D539L, 0x2AF26013L,
0xC5D1B023L, 0x286085F0L, 0xCA417918L, 0xB8DB38EFL,
0x8E79DCB0L, 0x603A180EL, 0x6C9E0E8BL, 0xB01E8A3EL,
0xD71577C1L, 0xBD314B27L, 0x78AF2FDAL, 0x55605C60L,
0xE65525F3L, 0xAA55AB94L, 0x57489862L, 0x63E81440L,
0x55CA396AL, 0x2AAB10B6L, 0xB4CC5C34L, 0x1141E8CEL,
0xA15486AFL, 0x7C72E993L, 0xB3EE1411L, 0x636FBC2AL,
0x2BA9C55DL, 0x741831F6L, 0xCE5C3E16L, 0x9B87931EL,
0xAFD6BA33L, 0x6C24CF5CL, 0x7A325381L, 0x28958677L,
0x3B8F4898L, 0x6B4BB9AFL, 0xC4BFE81BL, 0x66282193L,
0x61D809CCL, 0xFB21A991L, 0x487CAC60L, 0x5DEC8032L,
0xEF845D5DL, 0xE98575B1L, 0xDC262302L, 0xEB651B88L,
0x23893E81L, 0xD396ACC5L, 0x0F6D6FF3L, 0x83F44239L,
0x2E0B4482L, 0xA4842004L, 0x69C8F04AL, 0x9E1F9B5EL,
0x21C66842L, 0xF6E96C9AL, 0x670C9C61L, 0xABD388F0L,
0x6A51A0D2L, 0xD8542F68L, 0x960FA728L, 0xAB5133A3L,
0x6EEF0B6CL, 0x137A3BE4L, 0xBA3BF050L, 0x7EFB2A98L,
0xA1F1651DL, 0x39AF0176L, 0x66CA593EL, 0x82430E88L,
0x8CEE8619L, 0x456F9FB4L, 0x7D84A5C3L, 0x3B8B5EBEL,
0xE06F75D8L, 0x85C12073L, 0x401A449FL, 0x56C16AA6L,
0x4ED3AA62L, 0x363F7706L, 0x1BFEDF72L, 0x429B023DL,
0x37D0D724L, 0xD00A1248L, 0xDB0FEAD3L, 0x49F1C09BL,
0x075372C9L, 0x80991B7BL, 0x25D479D8L, 0xF6E8DEF7L,
0xE3FE501AL, 0xB6794C3BL, 0x976CE0BDL, 0x04C006BAL,
0xC1A94FB6L, 0x409F60C4L, 0x5E5C9EC2L, 0x196A2463L,
0x68FB6FAFL, 0x3E6C53B5L, 0x1339B2EBL, 0x3B52EC6FL,
0x6DFC511FL, 0x9B30952CL, 0xCC814544L, 0xAF5EBD09L,
0xBEE3D004L, 0xDE334AFDL, 0x660F2807L, 0x192E4BB3L,
0xC0CBA857L, 0x45C8740FL, 0xD20B5F39L, 0xB9D3FBDBL,
0x5579C0BDL, 0x1A60320AL, 0xD6A100C6L, 0x402C7279L,
0x679F25FEL, 0xFB1FA3CCL, 0x8EA5E9F8L, 0xDB3222F8L,
0x3C7516DFL, 0xFD616B15L, 0x2F501EC8L, 0xAD0552ABL,
0x323DB5FAL, 0xFD238760L, 0x53317B48L, 0x3E00DF82L,
0x9E5C57BBL, 0xCA6F8CA0L, 0x1A87562EL, 0xDF1769DBL,
0xD542A8F6L, 0x287EFFC3L, 0xAC6732C6L, 0x8C4F5573L,
0x695B27B0L, 0xBBCA58C8L, 0xE1FFA35DL, 0xB8F011A0L,
0x10FA3D98L, 0xFD2183B8L, 0x4AFCB56CL, 0x2DD1D35BL,
0x9A53E479L, 0xB6F84565L, 0xD28E49BCL, 0x4BFB9790L,
0xE1DDF2DAL, 0xA4CB7E33L, 0x62FB1341L, 0xCEE4C6E8L,
0xEF20CADAL, 0x36774C01L, 0xD07E9EFEL, 0x2BF11FB4L,
0x95DBDA4DL, 0xAE909198L, 0xEAAD8E71L, 0x6B93D5A0L,
0xD08ED1D0L, 0xAFC725E0L, 0x8E3C5B2FL, 0x8E7594B7L,
0x8FF6E2FBL, 0xF2122B64L, 0x8888B812L, 0x900DF01CL,
0x4FAD5EA0L, 0x688FC31CL, 0xD1CFF191L, 0xB3A8C1ADL,
0x2F2F2218L, 0xBE0E1777L, 0xEA752DFEL, 0x8B021FA1L,
0xE5A0CC0FL, 0xB56F74E8L, 0x18ACF3D6L, 0xCE89E299L,
0xB4A84FE0L, 0xFD13E0B7L, 0x7CC43B81L, 0xD2ADA8D9L,
0x165FA266L, 0x80957705L, 0x93CC7314L, 0x211A1477L,
0xE6AD2065L, 0x77B5FA86L, 0xC75442F5L, 0xFB9D35CFL,
0xEBCDAF0CL, 0x7B3E89A0L, 0xD6411BD3L, 0xAE1E7E49L,
0x00250E2DL, 0x2071B35EL, 0x226800BBL, 0x57B8E0AFL,
0x2464369BL, 0xF009B91EL, 0x5563911DL, 0x59DFA6AAL,
0x78C14389L, 0xD95A537FL, 0x207D5BA2L, 0x02E5B9C5L,
0x83260376L, 0x6295CFA9L, 0x11C81968L, 0x4E734A41L,
0xB3472DCAL, 0x7B14A94AL, 0x1B510052L, 0x9A532915L,
0xD60F573FL, 0xBC9BC6E4L, 0x2B60A476L, 0x81E67400L,
0x08BA6FB5L, 0x571BE91FL, 0xF296EC6BL, 0x2A0DD915L,
0xB6636521L, 0xE7B9F9B6L, 0xFF34052EL, 0xC5855664L,
0x53B02D5DL, 0xA99F8FA1L, 0x08BA4799L, 0x6E85076AL },
{ 0x4B7A70E9L, 0xB5B32944L, 0xDB75092EL, 0xC4192623L,
0xAD6EA6B0L, 0x49A7DF7DL, 0x9CEE60B8L, 0x8FEDB266L,
0xECAA8C71L, 0x699A17FFL, 0x5664526CL, 0xC2B19EE1L,
0x193602A5L, 0x75094C29L, 0xA0591340L, 0xE4183A3EL,
0x3F54989AL, 0x5B429D65L, 0x6B8FE4D6L, 0x99F73FD6L,
0xA1D29C07L, 0xEFE830F5L, 0x4D2D38E6L, 0xF0255DC1L,
0x4CDD2086L, 0x8470EB26L, 0x6382E9C6L, 0x021ECC5EL,
0x09686B3FL, 0x3EBAEFC9L, 0x3C971814L, 0x6B6A70A1L,
0x687F3584L, 0x52A0E286L, 0xB79C5305L, 0xAA500737L,
0x3E07841CL, 0x7FDEAE5CL, 0x8E7D44ECL, 0x5716F2B8L,
0xB03ADA37L, 0xF0500C0DL, 0xF01C1F04L, 0x0200B3FFL,
0xAE0CF51AL, 0x3CB574B2L, 0x25837A58L, 0xDC0921BDL,
0xD19113F9L, 0x7CA92FF6L, 0x94324773L, 0x22F54701L,
0x3AE5E581L, 0x37C2DADCL, 0xC8B57634L, 0x9AF3DDA7L,
0xA9446146L, 0x0FD0030EL, 0xECC8C73EL, 0xA4751E41L,
0xE238CD99L, 0x3BEA0E2FL, 0x3280BBA1L, 0x183EB331L,
0x4E548B38L, 0x4F6DB908L, 0x6F420D03L, 0xF60A04BFL,
0x2CB81290L, 0x24977C79L, 0x5679B072L, 0xBCAF89AFL,
0xDE9A771FL, 0xD9930810L, 0xB38BAE12L, 0xDCCF3F2EL,
0x5512721FL, 0x2E6B7124L, 0x501ADDE6L, 0x9F84CD87L,
0x7A584718L, 0x7408DA17L, 0xBC9F9ABCL, 0xE94B7D8CL,
0xEC7AEC3AL, 0xDB851DFAL, 0x63094366L, 0xC464C3D2L,
0xEF1C1847L, 0x3215D908L, 0xDD433B37L, 0x24C2BA16L,
0x12A14D43L, 0x2A65C451L, 0x50940002L, 0x133AE4DDL,
0x71DFF89EL, 0x10314E55L, 0x81AC77D6L, 0x5F11199BL,
0x043556F1L, 0xD7A3C76BL, 0x3C11183BL, 0x5924A509L,
0xF28FE6EDL, 0x97F1FBFAL, 0x9EBABF2CL, 0x1E153C6EL,
0x86E34570L, 0xEAE96FB1L, 0x860E5E0AL, 0x5A3E2AB3L,
0x771FE71CL, 0x4E3D06FAL, 0x2965DCB9L, 0x99E71D0FL,
0x803E89D6L, 0x5266C825L, 0x2E4CC978L, 0x9C10B36AL,
0xC6150EBAL, 0x94E2EA78L, 0xA5FC3C53L, 0x1E0A2DF4L,
0xF2F74EA7L, 0x361D2B3DL, 0x1939260FL, 0x19C27960L,
0x5223A708L, 0xF71312B6L, 0xEBADFE6EL, 0xEAC31F66L,
0xE3BC4595L, 0xA67BC883L, 0xB17F37D1L, 0x018CFF28L,
0xC332DDEFL, 0xBE6C5AA5L, 0x65582185L, 0x68AB9802L,
0xEECEA50FL, 0xDB2F953BL, 0x2AEF7DADL, 0x5B6E2F84L,
0x1521B628L, 0x29076170L, 0xECDD4775L, 0x619F1510L,
0x13CCA830L, 0xEB61BD96L, 0x0334FE1EL, 0xAA0363CFL,
0xB5735C90L, 0x4C70A239L, 0xD59E9E0BL, 0xCBAADE14L,
0xEECC86BCL, 0x60622CA7L, 0x9CAB5CABL, 0xB2F3846EL,
0x648B1EAFL, 0x19BDF0CAL, 0xA02369B9L, 0x655ABB50L,
0x40685A32L, 0x3C2AB4B3L, 0x319EE9D5L, 0xC021B8F7L,
0x9B540B19L, 0x875FA099L, 0x95F7997EL, 0x623D7DA8L,
0xF837889AL, 0x97E32D77L, 0x11ED935FL, 0x16681281L,
0x0E358829L, 0xC7E61FD6L, 0x96DEDFA1L, 0x7858BA99L,
0x57F584A5L, 0x1B227263L, 0x9B83C3FFL, 0x1AC24696L,
0xCDB30AEBL, 0x532E3054L, 0x8FD948E4L, 0x6DBC3128L,
0x58EBF2EFL, 0x34C6FFEAL, 0xFE28ED61L, 0xEE7C3C73L,
0x5D4A14D9L, 0xE864B7E3L, 0x42105D14L, 0x203E13E0L,
0x45EEE2B6L, 0xA3AAABEAL, 0xDB6C4F15L, 0xFACB4FD0L,
0xC742F442L, 0xEF6ABBB5L, 0x654F3B1DL, 0x41CD2105L,
0xD81E799EL, 0x86854DC7L, 0xE44B476AL, 0x3D816250L,
0xCF62A1F2L, 0x5B8D2646L, 0xFC8883A0L, 0xC1C7B6A3L,
0x7F1524C3L, 0x69CB7492L, 0x47848A0BL, 0x5692B285L,
0x095BBF00L, 0xAD19489DL, 0x1462B174L, 0x23820E00L,
0x58428D2AL, 0x0C55F5EAL, 0x1DADF43EL, 0x233F7061L,
0x3372F092L, 0x8D937E41L, 0xD65FECF1L, 0x6C223BDBL,
0x7CDE3759L, 0xCBEE7460L, 0x4085F2A7L, 0xCE77326EL,
0xA6078084L, 0x19F8509EL, 0xE8EFD855L, 0x61D99735L,
0xA969A7AAL, 0xC50C06C2L, 0x5A04ABFCL, 0x800BCADCL,
0x9E447A2EL, 0xC3453484L, 0xFDD56705L, 0x0E1E9EC9L,
0xDB73DBD3L, 0x105588CDL, 0x675FDA79L, 0xE3674340L,
0xC5C43465L, 0x713E38D8L, 0x3D28F89EL, 0xF16DFF20L,
0x153E21E7L, 0x8FB03D4AL, 0xE6E39F2BL, 0xDB83ADF7L },
{ 0xE93D5A68L, 0x948140F7L, 0xF64C261CL, 0x94692934L,
0x411520F7L, 0x7602D4F7L, 0xBCF46B2EL, 0xD4A20068L,
0xD4082471L, 0x3320F46AL, 0x43B7D4B7L, 0x500061AFL,
0x1E39F62EL, 0x97244546L, 0x14214F74L, 0xBF8B8840L,
0x4D95FC1DL, 0x96B591AFL, 0x70F4DDD3L, 0x66A02F45L,
0xBFBC09ECL, 0x03BD9785L, 0x7FAC6DD0L, 0x31CB8504L,
0x96EB27B3L, 0x55FD3941L, 0xDA2547E6L, 0xABCA0A9AL,
0x28507825L, 0x530429F4L, 0x0A2C86DAL, 0xE9B66DFBL,
0x68DC1462L, 0xD7486900L, 0x680EC0A4L, 0x27A18DEEL,
0x4F3FFEA2L, 0xE887AD8CL, 0xB58CE006L, 0x7AF4D6B6L,
0xAACE1E7CL, 0xD3375FECL, 0xCE78A399L, 0x406B2A42L,
0x20FE9E35L, 0xD9F385B9L, 0xEE39D7ABL, 0x3B124E8BL,
0x1DC9FAF7L, 0x4B6D1856L, 0x26A36631L, 0xEAE397B2L,
0x3A6EFA74L, 0xDD5B4332L, 0x6841E7F7L, 0xCA7820FBL,
0xFB0AF54EL, 0xD8FEB397L, 0x454056ACL, 0xBA489527L,
0x55533A3AL, 0x20838D87L, 0xFE6BA9B7L, 0xD096954BL,
0x55A867BCL, 0xA1159A58L, 0xCCA92963L, 0x99E1DB33L,
0xA62A4A56L, 0x3F3125F9L, 0x5EF47E1CL, 0x9029317CL,
0xFDF8E802L, 0x04272F70L, 0x80BB155CL, 0x05282CE3L,
0x95C11548L, 0xE4C66D22L, 0x48C1133FL, 0xC70F86DCL,
0x07F9C9EEL, 0x41041F0FL, 0x404779A4L, 0x5D886E17L,
0x325F51EBL, 0xD59BC0D1L, 0xF2BCC18FL, 0x41113564L,
0x257B7834L, 0x602A9C60L, 0xDFF8E8A3L, 0x1F636C1BL,
0x0E12B4C2L, 0x02E1329EL, 0xAF664FD1L, 0xCAD18115L,
0x6B2395E0L, 0x333E92E1L, 0x3B240B62L, 0xEEBEB922L,
0x85B2A20EL, 0xE6BA0D99L, 0xDE720C8CL, 0x2DA2F728L,
0xD0127845L, 0x95B794FDL, 0x647D0862L, 0xE7CCF5F0L,
0x5449A36FL, 0x877D48FAL, 0xC39DFD27L, 0xF33E8D1EL,
0x0A476341L, 0x992EFF74L, 0x3A6F6EABL, 0xF4F8FD37L,
0xA812DC60L, 0xA1EBDDF8L, 0x991BE14CL, 0xDB6E6B0DL,
0xC67B5510L, 0x6D672C37L, 0x2765D43BL, 0xDCD0E804L,
0xF1290DC7L, 0xCC00FFA3L, 0xB5390F92L, 0x690FED0BL,
0x667B9FFBL, 0xCEDB7D9CL, 0xA091CF0BL, 0xD9155EA3L,
0xBB132F88L, 0x515BAD24L, 0x7B9479BFL, 0x763BD6EBL,
0x37392EB3L, 0xCC115979L, 0x8026E297L, 0xF42E312DL,
0x6842ADA7L, 0xC66A2B3BL, 0x12754CCCL, 0x782EF11CL,
0x6A124237L, 0xB79251E7L, 0x06A1BBE6L, 0x4BFB6350L,
0x1A6B1018L, 0x11CAEDFAL, 0x3D25BDD8L, 0xE2E1C3C9L,
0x44421659L, 0x0A121386L, 0xD90CEC6EL, 0xD5ABEA2AL,
0x64AF674EL, 0xDA86A85FL, 0xBEBFE988L, 0x64E4C3FEL,
0x9DBC8057L, 0xF0F7C086L, 0x60787BF8L, 0x6003604DL,
0xD1FD8346L, 0xF6381FB0L, 0x7745AE04L, 0xD736FCCCL,
0x83426B33L, 0xF01EAB71L, 0xB0804187L, 0x3C005E5FL,
0x77A057BEL, 0xBDE8AE24L, 0x55464299L, 0xBF582E61L,
0x4E58F48FL, 0xF2DDFDA2L, 0xF474EF38L, 0x8789BDC2L,
0x5366F9C3L, 0xC8B38E74L, 0xB475F255L, 0x46FCD9B9L,
0x7AEB2661L, 0x8B1DDF84L, 0x846A0E79L, 0x915F95E2L,
0x466E598EL, 0x20B45770L, 0x8CD55591L, 0xC902DE4CL,
0xB90BACE1L, 0xBB8205D0L, 0x11A86248L, 0x7574A99EL,
0xB77F19B6L, 0xE0A9DC09L, 0x662D09A1L, 0xC4324633L,
0xE85A1F02L, 0x09F0BE8CL, 0x4A99A025L, 0x1D6EFE10L,
0x1AB93D1DL, 0x0BA5A4DFL, 0xA186F20FL, 0x2868F169L,
0xDCB7DA83L, 0x573906FEL, 0xA1E2CE9BL, 0x4FCD7F52L,
0x50115E01L, 0xA70683FAL, 0xA002B5C4L, 0x0DE6D027L,
0x9AF88C27L, 0x773F8641L, 0xC3604C06L, 0x61A806B5L,
0xF0177A28L, 0xC0F586E0L, 0x006058AAL, 0x30DC7D62L,
0x11E69ED7L, 0x2338EA63L, 0x53C2DD94L, 0xC2C21634L,
0xBBCBEE56L, 0x90BCB6DEL, 0xEBFC7DA1L, 0xCE591D76L,
0x6F05E409L, 0x4B7C0188L, 0x39720A3DL, 0x7C927C24L,
0x86E3725FL, 0x724D9DB9L, 0x1AC15BB4L, 0xD39EB8FCL,
0xED545578L, 0x08FCA5B5L, 0xD83D7CD3L, 0x4DAD0FC4L,
0x1E50EF5EL, 0xB161E6F8L, 0xA28514D9L, 0x6C51133CL,
0x6FD5C7E7L, 0x56E14EC4L, 0x362ABFCEL, 0xDDC6C837L,
0xD79A3234L, 0x92638212L, 0x670EFA8EL, 0x406000E0L },
{ 0x3A39CE37L, 0xD3FAF5CFL, 0xABC27737L, 0x5AC52D1BL,
0x5CB0679EL, 0x4FA33742L, 0xD3822740L, 0x99BC9BBEL,
0xD5118E9DL, 0xBF0F7315L, 0xD62D1C7EL, 0xC700C47BL,
0xB78C1B6BL, 0x21A19045L, 0xB26EB1BEL, 0x6A366EB4L,
0x5748AB2FL, 0xBC946E79L, 0xC6A376D2L, 0x6549C2C8L,
0x530FF8EEL, 0x468DDE7DL, 0xD5730A1DL, 0x4CD04DC6L,
0x2939BBDBL, 0xA9BA4650L, 0xAC9526E8L, 0xBE5EE304L,
0xA1FAD5F0L, 0x6A2D519AL, 0x63EF8CE2L, 0x9A86EE22L,
0xC089C2B8L, 0x43242EF6L, 0xA51E03AAL, 0x9CF2D0A4L,
0x83C061BAL, 0x9BE96A4DL, 0x8FE51550L, 0xBA645BD6L,
0x2826A2F9L, 0xA73A3AE1L, 0x4BA99586L, 0xEF5562E9L,
0xC72FEFD3L, 0xF752F7DAL, 0x3F046F69L, 0x77FA0A59L,
0x80E4A915L, 0x87B08601L, 0x9B09E6ADL, 0x3B3EE593L,
0xE990FD5AL, 0x9E34D797L, 0x2CF0B7D9L, 0x022B8B51L,
0x96D5AC3AL, 0x017DA67DL, 0xD1CF3ED6L, 0x7C7D2D28L,
0x1F9F25CFL, 0xADF2B89BL, 0x5AD6B472L, 0x5A88F54CL,
0xE029AC71L, 0xE019A5E6L, 0x47B0ACFDL, 0xED93FA9BL,
0xE8D3C48DL, 0x283B57CCL, 0xF8D56629L, 0x79132E28L,
0x785F0191L, 0xED756055L, 0xF7960E44L, 0xE3D35E8CL,
0x15056DD4L, 0x88F46DBAL, 0x03A16125L, 0x0564F0BDL,
0xC3EB9E15L, 0x3C9057A2L, 0x97271AECL, 0xA93A072AL,
0x1B3F6D9BL, 0x1E6321F5L, 0xF59C66FBL, 0x26DCF319L,
0x7533D928L, 0xB155FDF5L, 0x03563482L, 0x8ABA3CBBL,
0x28517711L, 0xC20AD9F8L, 0xABCC5167L, 0xCCAD925FL,
0x4DE81751L, 0x3830DC8EL, 0x379D5862L, 0x9320F991L,
0xEA7A90C2L, 0xFB3E7BCEL, 0x5121CE64L, 0x774FBE32L,
0xA8B6E37EL, 0xC3293D46L, 0x48DE5369L, 0x6413E680L,
0xA2AE0810L, 0xDD6DB224L, 0x69852DFDL, 0x09072166L,
0xB39A460AL, 0x6445C0DDL, 0x586CDECFL, 0x1C20C8AEL,
0x5BBEF7DDL, 0x1B588D40L, 0xCCD2017FL, 0x6BB4E3BBL,
0xDDA26A7EL, 0x3A59FF45L, 0x3E350A44L, 0xBCB4CDD5L,
0x72EACEA8L, 0xFA6484BBL, 0x8D6612AEL, 0xBF3C6F47L,
0xD29BE463L, 0x542F5D9EL, 0xAEC2771BL, 0xF64E6370L,
0x740E0D8DL, 0xE75B1357L, 0xF8721671L, 0xAF537D5DL,
0x4040CB08L, 0x4EB4E2CCL, 0x34D2466AL, 0x0115AF84L,
0xE1B00428L, 0x95983A1DL, 0x06B89FB4L, 0xCE6EA048L,
0x6F3F3B82L, 0x3520AB82L, 0x011A1D4BL, 0x277227F8L,
0x611560B1L, 0xE7933FDCL, 0xBB3A792BL, 0x344525BDL,
0xA08839E1L, 0x51CE794BL, 0x2F32C9B7L, 0xA01FBAC9L,
0xE01CC87EL, 0xBCC7D1F6L, 0xCF0111C3L, 0xA1E8AAC7L,
0x1A908749L, 0xD44FBD9AL, 0xD0DADECBL, 0xD50ADA38L,
0x0339C32AL, 0xC6913667L, 0x8DF9317CL, 0xE0B12B4FL,
0xF79E59B7L, 0x43F5BB3AL, 0xF2D519FFL, 0x27D9459CL,
0xBF97222CL, 0x15E6FC2AL, 0x0F91FC71L, 0x9B941525L,
0xFAE59361L, 0xCEB69CEBL, 0xC2A86459L, 0x12BAA8D1L,
0xB6C1075EL, 0xE3056A0CL, 0x10D25065L, 0xCB03A442L,
0xE0EC6E0EL, 0x1698DB3BL, 0x4C98A0BEL, 0x3278E964L,
0x9F1F9532L, 0xE0D392DFL, 0xD3A0342BL, 0x8971F21EL,
0x1B0A7441L, 0x4BA3348CL, 0xC5BE7120L, 0xC37632D8L,
0xDF359F8DL, 0x9B992F2EL, 0xE60B6F47L, 0x0FE3F11DL,
0xE54CDA54L, 0x1EDAD891L, 0xCE6279CFL, 0xCD3E7E6FL,
0x1618B166L, 0xFD2C1D05L, 0x848FD2C5L, 0xF6FB2299L,
0xF523F357L, 0xA6327623L, 0x93A83531L, 0x56CCCD02L,
0xACF08162L, 0x5A75EBB5L, 0x6E163697L, 0x88D273CCL,
0xDE966292L, 0x81B949D0L, 0x4C50901BL, 0x71C65614L,
0xE6C6C7BDL, 0x327A140AL, 0x45E1D006L, 0xC3F27B9AL,
0xC9AA53FDL, 0x62A80F00L, 0xBB25BFE2L, 0x35BDD2F6L,
0x71126905L, 0xB2040222L, 0xB6CBCF7CL, 0xCD769C2BL,
0x53113EC0L, 0x1640E3D3L, 0x38ABBD60L, 0x2547ADF0L,
0xBA38209CL, 0xF746CE76L, 0x77AFA1C5L, 0x20756060L,
0x85CBFE4EL, 0x8AE88DD8L, 0x7AAAF9B0L, 0x4CF9AA7EL,
0x1948C25CL, 0x02FB8A8CL, 0x01C36AE4L, 0xD6EBE1F9L,
0x90D4F869L, 0xA65CDEA0L, 0x3F09252DL, 0xC208E69FL,
0xB74E6132L, 0xCE77E25BL, 0x578FDFE3L, 0x3AC372E6L }
};
uInt32 F(BLOWFISH_CTX *ctx, uInt32 x) {
unsigned short a, b, c, d;
uInt32 y;
d = x & 0x00FF;
x >>= 8;
c = x & 0x00FF;
x >>= 8;
b = x & 0x00FF;
x >>= 8;
a = x & 0x00FF;
y = ctx->S[0][a] + ctx->S[1][b];
y = y ^ ctx->S[2][c];
y = y + ctx->S[3][d];
return y;
}
void Blowfish_Encrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32
*xr) {
uInt32 Xl;
uInt32 Xr;
uInt32 temp;
short i;
Xl = *xl;
Xr = *xr;
for (i = 0; i < N; ++i) {
Xl = Xl ^ ctx->P[i];
Xr = F(ctx, Xl) ^ Xr;
temp = Xl;
Xl = Xr;
Xr = temp;
}
temp = Xl;
Xl = Xr;
Xr = temp;
Xr = Xr ^ ctx->P[N];
Xl = Xl ^ ctx->P[N + 1];
*xl = Xl;
*xr = Xr;
}
void Blowfish_Decrypt(BLOWFISH_CTX *ctx, uInt32 *xl, uInt32
*xr) {
uInt32 Xl;
uInt32 Xr;
uInt32 temp;
short i;
Xl = *xl;
Xr = *xr;
for (i = N + 1; i > 1; --i) {
Xl = Xl ^ ctx->P[i];
Xr = F(ctx, Xl) ^ Xr;
/* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
}
/* Exchange Xl and Xr */
temp = Xl;
Xl = Xr;
Xr = temp;
Xr = Xr ^ ctx->P[1];
Xl = Xl ^ ctx->P[0];
*xl = Xl;
*xr = Xr;
}
void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen) {
int i, j, k;
uInt32 data, datal, datar;
for (i = 0; i < 4; i++) {
for (j = 0; j < 256; j++)
ctx->S[i][j] = ORIG_S[i][j];
}
j = 0;
for (i = 0; i < N + 2; ++i) {
data = 0x00000000;
for (k = 0; k < 4; ++k) {
data = (data << 8) | key[j];
j = j + 1;
if (j >= keyLen)
j = 0;
}
ctx->P[i] = ORIG_P[i] ^ data;
}
datal = 0x00000000;
datar = 0x00000000;
for (i = 0; i < N + 2; i += 2) {
Blowfish_Encrypt(ctx, &datal, &datar);
ctx->P[i] = datal;
ctx->P[i + 1] = datar;
}
for (i = 0; i < 4; ++i) {
for (j = 0; j < 256; j += 2) {
Blowfish_Encrypt(ctx, &datal, &datar);
ctx->S[i][j] = datal;
ctx->S[i][j + 1] = datar;
}
}
}

View File

@ -0,0 +1,74 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
void getEndian(unsigned char **e) {
short i = 0x4321;
int bigE = (*(char*) &i);
if ((*e = realloc(*e, sizeof(char) + 1)) == NULL)
memerror();
memset(*e, 0, sizeof(char) + 1);
if (bigE == 0x43)
memset(*e, endianBig, 1);
else if (bigE == 0x21)
memset(*e, endianLittle, 1);
}
uInt32 swapEndian(uInt32 value) {
unsigned int b1, b2, b3, b4;
uInt32 swapped;
b4 = (value>>24) & 0xff;
b3 = (value>>16) & 0xff;
b2 = (value>>8) & 0xff;
b1 = value & 0xff;
swapped = (b1<<24) | (b2<<16) | (b3<<8) | b4;
return(swapped);
}
int testEndian(char *input) {
unsigned char *myEndian = NULL, *yourEndian = NULL;
getEndian(&myEndian);
if ((yourEndian = malloc(2)) == NULL)
memerror();
memset(yourEndian, 0, 2);
memcpy(yourEndian, input, 1);
if (memcmp(myEndian, yourEndian, 1) == 0)
return(0);
return(1);
}
int swapCompressed(char **input, uLong sz) {
char c;
unsigned int j, swap;
memcpy(&c, *input+1, 1);
if (c == 0)
return(0);
j = sizeof(uInt32);
memcpy(&swap, *input+(sz - j), j);
swap = swapEndian(swap);
memcpy(*input+(sz - j), &swap, j);
return(1);
}

View File

@ -0,0 +1,94 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
char * getkey(int type,char* TheKey)
{
char *key, *key2, overflow[2], *ch;
if ((key = malloc(MAXKEYBYTES + 2)) == NULL) memerror();
memset(key, 0, MAXKEYBYTES + 2);
strcpy(key,TheKey);
/* blowfish requires 32 bits, I want 64. deal w/ it */
if (strlen(key) < 9 && type == ENCRYPT)
{ /* \n is still tacked on */
fprintf(stderr, "Key must be at least 8 characters\n");
memset(key, 0, MAXKEYBYTES + 2);
return "";
}
if (type == ENCRYPT)
{
if ((key2 = malloc(MAXKEYBYTES + 2)) == NULL) memerror();
memset(key2, 0, MAXKEYBYTES + 2);
strcpy(key2,TheKey);
if (strcmp(key, key2))
{
fprintf(stderr, "\nKeys don't match!\n");
return "";
}
memset(key2, 0, strlen(key2));
free(key2);
}
if ((ch = memchr(key, (char) 10, strlen(key))) != NULL) memset(ch, 0, 1);
return(key);
}
void mutateKey(char **key, char **key2) {
uInt32 L, R, l, r;
BLOWFISH_CTX ctx;
char *newkey, *newkey2;
int i, j;
j = sizeof(uInt32);
Blowfish_Init(&ctx, *key, strlen(*key));
memcpy(&L, *key, j);
memcpy(&R, *key+j, j);
memset(*key, 0, MAXKEYBYTES + 1);
l = L;
r = R;
if ((*key2 = malloc(MAXKEYBYTES + 1)) == NULL)
memerror();
if ((newkey = malloc(MAXKEYBYTES + 1)) == NULL)
memerror();
if ((newkey2 = malloc(MAXKEYBYTES + 1)) == NULL)
memerror();
memset(*key2, 0, MAXKEYBYTES + 1);
memset(newkey, 0, MAXKEYBYTES + 1);
memset(newkey2, 0, MAXKEYBYTES + 1);
for (i=0; i < MAXKEYBYTES; i+=(j*2)) {
Blowfish_Encrypt(&ctx, &L, &R);
memcpy(newkey+i, &L, j);
memcpy(newkey+i+j, &R, j);
}
for (i=0; i < MAXKEYBYTES; i+=(j*2)) {
l = swapEndian(l);
r = swapEndian(r);
Blowfish_Encrypt(&ctx, &l, &r);
l = swapEndian(l);
r = swapEndian(r);
memcpy(newkey2+i, &l, j);
memcpy(newkey2+i+j, &r, j);
}
memcpy(*key, newkey, MAXKEYBYTES);
memcpy(*key2, newkey2, MAXKEYBYTES);
free(newkey);
}

View File

@ -0,0 +1,148 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
int getremain(uLong sz, int dv) {
int r;
r = sz / dv;
r++;
r = r * dv;
r = r - sz;
return(r);
}
uLong padInput(char **input, uLong sz) {
int r, j;
j = sizeof(uInt32) * 2;
if (sz >= j)
r = getremain(sz, j);
else
r = j - sz;
if ( r < j) {
if ((*input = realloc(*input, sz + r + 1)) == NULL)
memerror();
memset(*input+sz, 0, r + 1);
sz+=r;
}
return(sz);
}
uLong attachKey(char **input, char *key, uLong sz) {
/* +3 so we have room for info tags at the beginning of the file */
if ((*input = realloc(*input, sz + MAXKEYBYTES + 3)) == NULL)
memerror();
memcpy(*input+sz, key, MAXKEYBYTES);
sz += MAXKEYBYTES;
return(sz);
}
uLong readfile(char *infile, char **input, int type, char *key,
struct stat statbuf) {
FILE *fd;
int readsize;
uLong sz = 0;
readsize = statbuf.st_size + 1;
fd = fopen(infile, "rb");
if (!fd) {
fprintf(stderr, "Unable to open file %s\n", infile);
return(-1);
}
if ((*input = malloc(readsize + sz + 1)) == NULL)
memerror();
memset(*input+sz, 0, readsize);
sz += fread(*input+sz, 1, readsize - 1, fd);
fclose(fd);
return(sz);
}
uLong writefile(char *outfile, char *output, uLong sz,
BCoptions options, struct stat statbuf) {
FILE *fd;
if (options.standardout == 1)
fd = stdout;
else
fd = fopen(outfile, "wb");
if (!fd) {
fprintf(stderr, "Unable to create file %s\n", outfile);
return 1;
}
if (fwrite(output, 1, sz, fd) != sz) {
fprintf(stderr, "Out of space while writing file %s\n", outfile);
return 1;
}
if (!options.standardout) {
fclose(fd);
chmod(outfile, statbuf.st_mode);
}
return(0);
}
int deletefile(char *file, BCoptions options, char *key, struct stat statbuf) {
int lsize;
long g;
uLong j = 0, k = 0;
signed char i;
char *state, *garbage;
FILE *fd;
if (options.securedelete > 0) {
lsize = sizeof(long);
k = (statbuf.st_size / lsize) + 1;
if ((state = malloc(257)) == NULL)
memerror();
initstate((unsigned long) key, state, 256);
if ((garbage = malloc(lsize + 1)) == NULL)
memerror();
fd = fopen(file, "r+b");
for (i = options.securedelete; i > 0; i--) {
fseek(fd, 0, SEEK_SET);
for (j = 0; j < k; j += lsize) {
g = random();
memcpy(garbage, &g, lsize);
fwrite(garbage, lsize, 1, fd);
}
fflush(fd);
}
fclose(fd);
}
if (unlink(file)) {
fprintf(stderr, "Error deleting file %s\n", file);
return(1);
}
return(0);
}

View File

@ -0,0 +1,117 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
uLong BFEncrypt(char **input, char *key, uLong sz, BCoptions *options) {
uInt32 L, R;
uLong i;
BLOWFISH_CTX ctx;
int j;
unsigned char *myEndian = NULL;
j = sizeof(uInt32);
getEndian(&myEndian);
memmove(*input+2, *input, sz);
memcpy(*input, myEndian, 1);
memcpy(*input+1, &options->compression, 1);
sz += 2; /* add room for endian and compress flags */
Blowfish_Init (&ctx, key, MAXKEYBYTES);
for (i = 2; i < sz; i+=(j*2)) { /* start just after tags */
memcpy(&L, *input+i, j);
memcpy(&R, *input+i+j, j);
Blowfish_Encrypt(&ctx, &L, &R);
memcpy(*input+i, &L, j);
memcpy(*input+i+j, &R, j);
}
if (options->compression == 1) {
if ((*input = realloc(*input, sz + j + 1)) == NULL)
memerror();
memset(*input+sz, 0, j + 1);
memcpy(*input+sz, &options->origsize, j);
sz += j; /* make room for the original size */
}
free(myEndian);
return(sz);
}
uLong BFDecrypt(char **input, char *key, char *key2, uLong sz,
BCoptions *options) {
uInt32 L, R;
uLong i;
BLOWFISH_CTX ctx;
int j, swap = 0;
unsigned char *myEndian = NULL;
char *mykey = NULL;
j = sizeof(uInt32);
if ((mykey = malloc(MAXKEYBYTES + 1)) == NULL)
memerror();
memset(mykey, 0, MAXKEYBYTES + 1);
if ((swap = testEndian(*input)) == 1)
memcpy(mykey, key2, MAXKEYBYTES);
else
memcpy(mykey, key, MAXKEYBYTES);
memcpy(&options->compression, *input+1, 1);
if (options->compression == 1) {
memcpy(&options->origsize, *input+(sz - j), j);
sz -= j; /* dump the size tag */
}
sz -= 2; /* now dump endian and compress flags */
Blowfish_Init (&ctx, mykey, MAXKEYBYTES);
for (i = 0; i < sz; i+=(j*2)) {
memcpy(&L, *input+i+2, j);
memcpy(&R, *input+i+j+2, j);
if (swap == 1) {
L = swapEndian(L);
R = swapEndian(R);
}
Blowfish_Decrypt(&ctx, &L, &R);
if (swap == 1) {
L = swapEndian(L);
R = swapEndian(R);
}
memcpy(*input+i, &L, j);
memcpy(*input+i+j, &R, j);
}
while (memcmp(*input+(sz-1), "\0", 1) == 0) /* strip excess nulls */
sz--; /* from decrypted files */
sz -= MAXKEYBYTES;
if (memcmp(*input+sz, mykey, MAXKEYBYTES) != 0)
return(0);
free(mykey);
free(myEndian);
return(sz);
}

View File

@ -0,0 +1,57 @@
/* ====================================================================
* Copyright (c) 2002 Johnny Shelley. All rights reserved.
*
* Bcrypt is licensed under the BSD software license. See the file
* called 'LICENSE' that you should have received with this software
* for details
* ====================================================================
*/
#include "includes.h"
#include "defines.h"
#include "functions.h"
uLong docompress(char **input, uLong sz) {
uLong newsz;
char *output;
newsz = sz + (sz *.1) + 13;
if ((output = malloc(newsz + 1)) == NULL)
memerror();
memset(output, 0, newsz + 1);
compress((Bytef *) output, &newsz, (const Bytef *) *input, sz);
free(*input);
if ((*input = malloc(newsz)) == NULL)
memerror();
memcpy(*input, output, newsz);
free(output);
return(newsz);
}
uLong douncompress(char **input, uLong sz, BCoptions options) {
char *output;
if ((output = malloc(options.origsize + 1)) == NULL)
memerror();
memset(output, 0, options.origsize + 1);
uncompress((Bytef *) output, (uLong *) &options.origsize,
(const Bytef *) *input, sz);
free(*input);
if ((*input = malloc(options.origsize)) == NULL)
memerror();
memcpy(*input, output, options.origsize);
free(output);
return(options.origsize);
}

View File

@ -0,0 +1,9 @@
/Script1.rc/1.1/Fri Sep 13 07:33:27 2002//
/bcrypt.dsp/1.1/Fri Sep 13 07:06:00 2002//
/bcrypt.dsw/1.1/Fri Sep 13 07:11:13 2002/-kb/
/getopt.c/1.1/Fri Sep 13 07:08:05 2002//
/getopt.h/1.1/Fri Sep 13 07:08:05 2002//
/icon1.ico/1.1/Fri Sep 13 07:11:13 2002/-kb/
/readme-win32.txt/1.1/Fri Sep 13 07:08:05 2002//
/resource.h/1.1/Fri Sep 13 07:08:05 2002//
D/DLLs////

View File

@ -0,0 +1 @@
bcrypt/win32console

View File

@ -0,0 +1 @@
/home/cvs

View File

@ -0,0 +1,4 @@
/libz.def/1.1/Fri Sep 13 07:08:10 2002//
/zconf.h/1.1/Fri Sep 13 07:08:10 2002//
/zlib.h/1.1/Fri Sep 13 07:08:10 2002//
D

View File

@ -0,0 +1 @@
bcrypt/win32console/DLLs

View File

@ -0,0 +1 @@
/home/cvs

View File

@ -0,0 +1,70 @@
; i:\MINGW\BIN\dlltool.exe -Cn -a -z libz.def --export-all-symbols adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
EXPORTS
gzseek @ 1 ;
_length_code @ 2 DATA ;
_tr_align @ 3 ;
_tr_flush_block @ 4 ;
_tr_init @ 5 ;
_tr_stored_block @ 6 ;
_tr_tally @ 7 ;
adler32 @ 8 ;
compress @ 9 ;
compress2 @ 10 ;
crc32 @ 11 ;
deflate @ 12 ;
deflateCopy @ 13 ;
deflateEnd @ 14 ;
deflateInit2_ @ 15 ;
deflateInit_ @ 16 ;
deflateParams @ 17 ;
deflateReset @ 18 ;
deflateSetDictionary @ 19 ;
deflate_copyright @ 20 DATA ;
get_crc_table @ 21 ;
gzclose @ 22 ;
gzdopen @ 23 ;
gzeof @ 24 ;
gzerror @ 25 ;
gzflush @ 26 ;
gzgetc @ 27 ;
gzgets @ 28 ;
gzopen @ 29 ;
gzprintf @ 30 ;
gzputc @ 31 ;
gzputs @ 32 ;
gzread @ 33 ;
gzrewind @ 34 ;
_dist_code @ 35 DATA ;
gzsetparams @ 36 ;
gztell @ 37 ;
gzwrite @ 38 ;
inflate @ 39 ;
inflateEnd @ 40 ;
inflateInit2_ @ 41 ;
inflateInit_ @ 42 ;
inflateReset @ 43 ;
inflateSetDictionary @ 44 ;
inflateSync @ 45 ;
inflateSyncPoint @ 46 ;
inflate_blocks @ 47 ;
inflate_blocks_free @ 48 ;
inflate_blocks_new @ 49 ;
inflate_blocks_reset @ 50 ;
inflate_blocks_sync_point @ 51 ;
inflate_codes @ 52 ;
inflate_codes_free @ 53 ;
inflate_codes_new @ 54 ;
inflate_copyright @ 55 DATA ;
inflate_fast @ 56 ;
inflate_flush @ 57 ;
inflate_mask @ 58 DATA ;
inflate_set_dictionary @ 59 ;
inflate_trees_bits @ 60 ;
inflate_trees_dynamic @ 61 ;
inflate_trees_fixed @ 62 ;
uncompress @ 63 ;
zError @ 64 ;
z_errmsg @ 65 DATA ;
zcalloc @ 66 ;
zcfree @ 67 ;
zlibVersion @ 68 ;

View File

@ -0,0 +1,279 @@
/* zconf.h -- configuration of the zlib compression library
* Copyright (C) 1995-2002 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id: zconf.h,v 1.1 2002/09/13 07:08:10 syntax Exp $ */
#ifndef _ZCONF_H
#define _ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
*/
#ifdef Z_PREFIX
# define deflateInit_ z_deflateInit_
# define deflate z_deflate
# define deflateEnd z_deflateEnd
# define inflateInit_ z_inflateInit_
# define inflate z_inflate
# define inflateEnd z_inflateEnd
# define deflateInit2_ z_deflateInit2_
# define deflateSetDictionary z_deflateSetDictionary
# define deflateCopy z_deflateCopy
# define deflateReset z_deflateReset
# define deflateParams z_deflateParams
# define inflateInit2_ z_inflateInit2_
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateReset z_inflateReset
# define compress z_compress
# define compress2 z_compress2
# define uncompress z_uncompress
# define adler32 z_adler32
# define crc32 z_crc32
# define get_crc_table z_get_crc_table
# define Byte z_Byte
# define uInt z_uInt
# define uLong z_uLong
# define Bytef z_Bytef
# define charf z_charf
# define intf z_intf
# define uIntf z_uIntf
# define uLongf z_uLongf
# define voidpf z_voidpf
# define voidp z_voidp
#endif
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
# define WIN32
#endif
#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
# ifndef __32BIT__
# define __32BIT__
# endif
#endif
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
#if defined(MSDOS) && !defined(__32BIT__)
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
# define STDC
#endif
#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
# ifndef STDC
# define STDC
# endif
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
# define const
# endif
#endif
/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
# define NO_DUMMY_DECL
#endif
/* Old Borland C incorrectly complains about missing returns: */
#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
# define NEED_DUMMY_RETURN
#endif
/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
# ifdef MAXSEG_64K
# define MAX_MEM_LEVEL 8
# else
# define MAX_MEM_LEVEL 9
# endif
#endif
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
* created by gzip. (Files created by minigzip can still be extracted by
* gzip.)
*/
#ifndef MAX_WBITS
# define MAX_WBITS 15 /* 32K LZ77 window */
#endif
/* The memory requirements for deflate are (in bytes):
(1 << (windowBits+2)) + (1 << (memLevel+9))
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
plus a few kilobytes for small objects. For example, if you want to reduce
the default memory requirements from 256K to 128K, compile with
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
that is, 32K for windowBits=15 (default value) plus a few kilobytes
for small objects.
*/
/* Type declarations */
#ifndef OF /* function prototypes */
# ifdef STDC
# define OF(args) args
# else
# define OF(args) ()
# endif
#endif
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
/* MSC small or medium model */
# define SMALL_MEDIUM
# ifdef _MSC_VER
# define FAR _far
# else
# define FAR far
# endif
#endif
#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
# ifndef __32BIT__
# define SMALL_MEDIUM
# define FAR _far
# endif
#endif
/* Compile with -DZLIB_DLL for Windows DLL support */
#if defined(ZLIB_DLL)
# if defined(_WINDOWS) || defined(WINDOWS)
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
# define ZEXPORT WINAPI
# ifdef WIN32
# define ZEXPORTVA WINAPIV
# else
# define ZEXPORTVA FAR _cdecl _export
# endif
# endif
# if defined (__BORLANDC__)
# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
# include <windows.h>
# define ZEXPORT __declspec(dllexport) WINAPI
# define ZEXPORTRVA __declspec(dllexport) WINAPIV
# else
# if defined (_Windows) && defined (__DLL__)
# define ZEXPORT _export
# define ZEXPORTVA _export
# endif
# endif
# endif
#endif
#if defined (__BEOS__)
# if defined (ZLIB_DLL)
# define ZEXTERN extern __declspec(dllexport)
# else
# define ZEXTERN extern __declspec(dllimport)
# endif
#endif
#ifndef ZEXPORT
# define ZEXPORT
#endif
#ifndef ZEXPORTVA
# define ZEXPORTVA
#endif
#ifndef ZEXTERN
# define ZEXTERN extern
#endif
#ifndef FAR
# define FAR
#endif
#if !defined(MACOS) && !defined(TARGET_OS_MAC)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
typedef unsigned long uLong; /* 32 bits or more */
#ifdef SMALL_MEDIUM
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
# define Bytef Byte FAR
#else
typedef Byte FAR Bytef;
#endif
typedef char FAR charf;
typedef int FAR intf;
typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
typedef void FAR *voidpf;
typedef void *voidp;
#else
typedef Byte FAR *voidpf;
typedef Byte *voidp;
#endif
#ifdef HAVE_UNISTD_H
# include <sys/types.h> /* for off_t */
# include <unistd.h> /* for SEEK_* and off_t */
# define z_off_t off_t
#endif
#ifndef SEEK_SET
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
#ifndef z_off_t
# define z_off_t long
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
# pragma map(deflateInit_,"DEIN")
# pragma map(deflateInit2_,"DEIN2")
# pragma map(deflateEnd,"DEEND")
# pragma map(inflateInit_,"ININ")
# pragma map(inflateInit2_,"ININ2")
# pragma map(inflateEnd,"INEND")
# pragma map(inflateSync,"INSY")
# pragma map(inflateSetDictionary,"INSEDI")
# pragma map(inflate_blocks,"INBL")
# pragma map(inflate_blocks_new,"INBLNE")
# pragma map(inflate_blocks_free,"INBLFR")
# pragma map(inflate_blocks_reset,"INBLRE")
# pragma map(inflate_codes_free,"INCOFR")
# pragma map(inflate_codes,"INCO")
# pragma map(inflate_fast,"INFA")
# pragma map(inflate_flush,"INFLU")
# pragma map(inflate_mask,"INMA")
# pragma map(inflate_set_dictionary,"INSEDI2")
# pragma map(inflate_copyright,"INCOPY")
# pragma map(inflate_trees_bits,"INTRBI")
# pragma map(inflate_trees_dynamic,"INTRDY")
# pragma map(inflate_trees_fixed,"INTRFI")
# pragma map(inflate_trees_free,"INTRFR")
#endif
#endif /* _ZCONF_H */

View File

@ -0,0 +1,893 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.1.4, March 11th, 2002
Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly Mark Adler
jloup@gzip.org madler@alumni.caltech.edu
The data format used by the zlib library is described by RFCs (Request for
Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
*/
#ifndef _ZLIB_H
#define _ZLIB_H
#include "zconf.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ZLIB_VERSION "1.1.4"
/*
The 'zlib' compression library provides in-memory compression and
decompression functions, including integrity checks of the uncompressed
data. This version of the library supports only one compression method
(deflation) but other algorithms will be added later and will have the same
stream interface.
Compression can be done in a single step if the buffers are large
enough (for example if an input file is mmap'ed), or can be done by
repeated calls of the compression function. In the latter case, the
application must provide more input and/or consume the output
(providing more output space) before each call.
The library also supports reading and writing files in gzip (.gz) format
with an interface similar to that of stdio.
The library does not install any signal handler. The decoder checks
the consistency of the compressed data, so the library should never
crash even in case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state;
typedef struct z_stream_s {
Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
uLong total_in; /* total nb of input bytes read so far */
Bytef *next_out; /* next output byte should be put there */
uInt avail_out; /* remaining free space at next_out */
uLong total_out; /* total nb of bytes output so far */
char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
int data_type; /* best guess about the data type: ascii or binary */
uLong adler; /* adler32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
typedef z_stream FAR *z_streamp;
/*
The application must update next_in and avail_in when avail_in has
dropped to zero. It must update next_out and avail_out when avail_out
has dropped to zero. The application must initialize zalloc, zfree and
opaque before calling the init function. All other fields are set by the
compression library and must not be updated by the application.
The opaque value provided by the application will be passed as the first
parameter for calls of zalloc and zfree. This can be useful for custom
memory management. The compression library attaches no meaning to the
opaque value.
zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
thread safe.
On 16-bit systems, the functions zalloc and zfree must be able to allocate
exactly 65536 bytes, but will not be required to allocate more than this
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
pointers returned by zalloc for objects of exactly 65536 bytes *must*
have their offset normalized to zero. The default allocation function
provided by this library ensures this (see zutil.c). To reduce memory
requirements and avoid any allocation of 64K objects, at the expense of
compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
The fields total_in and total_out can be used for statistics or
progress reports. After compression, total_in holds the total size of
the uncompressed data and may be saved for use in the decompressor
(particularly if the decompressor wants to decompress everything in
a single step).
*/
/* constants */
#define Z_NO_FLUSH 0
#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
/* Allowed flush values; see deflate() below for details */
#define Z_OK 0
#define Z_STREAM_END 1
#define Z_NEED_DICT 2
#define Z_ERRNO (-1)
#define Z_STREAM_ERROR (-2)
#define Z_DATA_ERROR (-3)
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
#define Z_VERSION_ERROR (-6)
/* Return codes for the compression/decompression functions. Negative
* values are errors, positive values are used for special but normal events.
*/
#define Z_NO_COMPRESSION 0
#define Z_BEST_SPEED 1
#define Z_BEST_COMPRESSION 9
#define Z_DEFAULT_COMPRESSION (-1)
/* compression levels */
#define Z_FILTERED 1
#define Z_HUFFMAN_ONLY 2
#define Z_DEFAULT_STRATEGY 0
/* compression strategy; see deflateInit2() below for details */
#define Z_BINARY 0
#define Z_ASCII 1
#define Z_UNKNOWN 2
/* Possible values of the data_type field */
#define Z_DEFLATED 8
/* The deflate compression method (the only one supported in this version) */
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
#define zlib_version zlibVersion()
/* for compatibility with versions < 1.0.2 */
/* basic functions */
ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
If the first character differs, the library code actually used is
not compatible with the zlib.h header file used by the application.
This check is automatically made by deflateInit and inflateInit.
*/
/*
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
Initializes the internal stream state for compression. The fields
zalloc, zfree and opaque must be initialized before by the caller.
If zalloc and zfree are set to Z_NULL, deflateInit updates them to
use default allocation functions.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
1 gives best speed, 9 gives best compression, 0 gives no compression at
all (the input data is simply copied a block at a time).
Z_DEFAULT_COMPRESSION requests a default compromise between speed and
compression (currently equivalent to level 6).
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if level is not a valid compression level,
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
with the version assumed by the caller (ZLIB_VERSION).
msg is set to null if there is no error message. deflateInit does not
perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may introduce some
output latency (reading input without producing any output) except when
forced to flush.
The detailed semantics are as follows. deflate performs one or both of the
following actions:
- Compress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
should be set only when necessary (in interactive applications).
Some output may be provided even if flush is not set.
Before the call of deflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating avail_in or avail_out accordingly; avail_out
should never be zero before the call. The application can consume the
compressed output when it wants, for example when the output buffer is full
(avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
and with zero avail_out, it must be called again after making room in the
output buffer because there might be more output pending.
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
that the decompressor can get all input data available so far. (In particular
avail_in is zero after the call if enough output space has been provided
before the call.) Flushing may degrade compression for some compression
algorithms and so it should be used only when necessary.
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
the compression.
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
avail_out).
If the parameter flush is set to Z_FINISH, pending input is processed,
pending output is flushed and deflate returns with Z_STREAM_END if there
was enough output space; if deflate returns with Z_OK, this function must be
called again with Z_FINISH and more output space (updated avail_out) but no
more input data, until it returns with Z_STREAM_END or an error. After
deflate has returned Z_STREAM_END, the only possible operations on the
stream are deflateReset or deflateEnd.
Z_FINISH can be used immediately after deflateInit if all the compression
is to be done in a single step. In this case, avail_out must be at least
0.1% larger than avail_in plus 12 bytes. If deflate does not return
Z_STREAM_END, then it must be called again as described above.
deflate() sets strm->adler to the adler32 checksum of all input read
so far (that is, total_in bytes).
deflate() may update data_type if it can make a good guess about
the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
binary. This field is only for information purposes and does not affect
the compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
(for example avail_in or avail_out was zero).
*/
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
prematurely (some input or output was discarded). In the error case,
msg may be set but then points to a static string (which must not be
deallocated).
*/
/*
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
value depends on the compression method), inflateInit determines the
compression method from the zlib header and allocates all data structures
accordingly; otherwise the allocation will be deferred to the first call of
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
version assumed by the caller. msg is set to null if there is no error
message. inflateInit does not perform any decompression apart from reading
the zlib header if present: this will be done by inflate(). (So next_in and
avail_in may be modified, but next_out and avail_out are unchanged.)
*/
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
buffer becomes empty or the output buffer becomes full. It may some
introduce some output latency (reading input without producing any output)
except when forced to flush.
The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in is updated and processing
will resume at this point for the next call of inflate().
- Provide more output starting at next_out and update next_out and avail_out
accordingly. inflate() provides as much output as possible, until there
is no more input data or no more space in the output buffer (see below
about the flush parameter).
Before the call of inflate(), the application should ensure that at least
one of the actions is possible, by providing more input and/or consuming
more output, and updating the next_* and avail_* values accordingly.
The application can consume the uncompressed output when it wants, for
example when the output buffer is full (avail_out == 0), or after each
call of inflate(). If inflate returns Z_OK and with zero avail_out, it
must be called again after making room in the output buffer because there
might be more output pending.
If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
output as possible to the output buffer. The flushing behavior of inflate is
not specified for values of the flush parameter other than Z_SYNC_FLUSH
and Z_FINISH, but the current implementation actually flushes as much output
as possible anyway.
inflate() should normally be called until it returns Z_STREAM_END or an
error. However if all decompression is to be performed in a single step
(a single call of inflate), the parameter flush should be set to
Z_FINISH. In this case all pending input is processed and all pending
output is flushed; avail_out must be large enough to hold all the
uncompressed data. (The size of the uncompressed data may have been saved
by the compressor for this purpose.) The next operation on this stream must
be inflateEnd to deallocate the decompression state. The use of Z_FINISH
is never required, but can be used to inform inflate that a faster routine
may be used for the single inflate() call.
If a preset dictionary is needed at this point (see inflateSetDictionary
below), inflate sets strm-adler to the adler32 checksum of the
dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
it sets strm->adler to the adler32 checksum of all output produced
so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
an error code as described below. At the end of the stream, inflate()
checks that its computed adler32 checksum is equal to that saved by the
compressor and returns Z_STREAM_END only if the checksum is correct.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
corrupted (input stream not conforming to the zlib format or incorrect
adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
(for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if no progress is possible or if there was not
enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
case, the application may then call inflateSync to look for a good
compression block.
*/
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
This function discards any unprocessed input and does not flush any
pending output.
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
was inconsistent. In the error case, msg may be set but then points to a
static string (which must not be deallocated).
*/
/* Advanced functions */
/*
The following functions are needed only in some special applications.
*/
/*
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
This is another version of deflateInit with more compression options. The
fields next_in, zalloc, zfree and opaque must be initialized before by
the caller.
The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
version of the library. Larger values of this parameter result in better
compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
The memLevel parameter specifies how much memory should be allocated
for the internal compression state. memLevel=1 uses minimum memory but
is slow and reduces compression ratio; memLevel=9 uses maximum memory
for optimal speed. The default value is 8. See zconf.h for total memory
usage as a function of windowBits and memLevel.
The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
string match). Filtered data consists mostly of small values with a
somewhat random distribution. In this case, the compression algorithm is
tuned to compress them better. The effect of Z_FILTERED is to force more
Huffman coding and less string matching; it is somewhat intermediate
between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
the compression ratio but not the correctness of the compressed output even
if it is not set appropriately.
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
method). msg is set to null if there is no error message. deflateInit2 does
not perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
without producing any compressed output. This function must be called
immediately after deflateInit, deflateInit2 or deflateReset, before any
call of deflate. The compressor and decompressor must use exactly the same
dictionary (see inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
discarded, for example if the dictionary is larger than the window size in
deflate or deflate2. Thus the strings most likely to be useful should be
put at the end of the dictionary, not at the front.
Upon return of this function, strm->adler is set to the Adler32 value
of the dictionary; the decompressor may later use this value to determine
which dictionary has been used by the compressor. (The Adler32 value
applies to the whole dictionary even if only a subset of the dictionary is
actually used by the compressor.)
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent (for example if deflate has already been called for this stream
or if the compression method is bsort). deflateSetDictionary does not
perform any compression: this will be done by deflate().
*/
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
compression state which can be quite large, so this strategy is slow and
can consume lots of memory.
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
(such as zalloc being NULL). msg is left unchanged in both source and
destination.
*/
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
This function is equivalent to deflateEnd followed by deflateInit,
but does not free and reallocate all the internal compression state.
The stream will keep the same compression level and any other attributes
that may have been set by deflateInit2.
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
int level,
int strategy));
/*
Dynamically update the compression level and compression strategy. The
interpretation of level and strategy is as in deflateInit2. This can be
used to switch between compression and straight copy of the input data, or
to switch to a different kind of input data requiring a different
strategy. If the compression level is changed, the input available so far
is compressed with the old level (and may be flushed); the new level will
take effect only at the next call of deflate().
Before the call of deflateParams, the stream state must be set as for
a call of deflate(), since the currently available input may have to
be compressed and flushed. In particular, strm->avail_out must be non-zero.
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
if strm->avail_out was zero.
*/
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
this version of the library. The default value is 15 if inflateInit is used
instead. If a compressed stream with a larger window size is given as
input, inflate() will return with the error code Z_DATA_ERROR instead of
trying to allocate a larger window.
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
memLevel). msg is set to null if there is no error message. inflateInit2
does not perform any decompression apart from reading the zlib header if
present: this will be done by inflate(). (So next_in and avail_in may be
modified, but next_out and avail_out are unchanged.)
*/
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
const Bytef *dictionary,
uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
sequence. This function must be called immediately after a call of inflate
if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
can be determined from the Adler32 value returned by this call of
inflate. The compressor and decompressor must use exactly the same
dictionary (see deflateSetDictionary).
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
parameter is invalid (such as NULL dictionary) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
expected one (incorrect Adler32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
Skips invalid compressed data until a full flush point (see above the
description of deflate with Z_FULL_FLUSH) can be found, or until all
available input is skipped. No output is provided.
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
if no more input was provided, Z_DATA_ERROR if no flush point has been found,
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
case, the application may save the current current value of total_in which
indicates where valid compressed data was found. In the error case, the
application may repeatedly call inflateSync, providing more input each time,
until success or end of the input data.
*/
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
but does not free and reallocate all the internal decompression state.
The stream will keep attributes that may have been set by inflateInit2.
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
stream state was inconsistent (such as zalloc or state being NULL).
*/
/* utility functions */
/*
The following utility functions are implemented on top of the
basic stream-oriented functions. To simplify the interface, some
default options are assumed (compression level and memory usage,
standard memory allocation functions). The source code of these
utility functions can easily be modified if you need special options.
*/
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be at least 0.1% larger than
sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
compressed buffer.
This function can be used to compress a whole file at once if the
input file is mmap'ed.
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen,
int level));
/*
Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
length of the source buffer. Upon entry, destLen is the total size of the
destination buffer, which must be at least 0.1% larger than sourceLen plus
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
the byte length of the source buffer. Upon entry, destLen is the total
size of the destination buffer, which must be large enough to hold the
entire uncompressed data. (The size of the uncompressed data must have
been saved previously by the compressor and transmitted to the decompressor
by some mechanism outside the scope of this compression library.)
Upon exit, destLen is the actual size of the compressed buffer.
This function can be used to decompress a whole file at once if the
input file is mmap'ed.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer, or Z_DATA_ERROR if the input data was corrupted.
*/
typedef voidp gzFile;
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
/*
Opens a gzip (.gz) file for reading or writing. The mode parameter
is as in fopen ("rb" or "wb") but can also include a compression level
("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
Huffman only compression as in "wb1h". (See the description
of deflateInit2 for more information about the strategy parameter.)
gzopen can be used to read a file which is not in gzip format; in this
case gzread will directly read from the file without decompression.
gzopen returns NULL if the file could not be opened or if there was
insufficient memory to allocate the (de)compression state; errno
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR). */
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
/*
gzdopen() associates a gzFile with the file descriptor fd. File
descriptors are obtained from calls like open, dup, creat, pipe or
fileno (in the file has been previously opened with fopen).
The mode parameter is as in gzopen.
The next call of gzclose on the returned gzFile will also close the
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
gzdopen returns NULL if there was insufficient memory to allocate
the (de)compression state.
*/
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
Dynamically update the compression level or strategy. See the description
of deflateInit2 for the meaning of these parameters.
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
opened for writing.
*/
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
Reads the given number of uncompressed bytes from the compressed file.
If the input file was not in gzip format, gzread copies the given number
of bytes into the buffer.
gzread returns the number of uncompressed bytes actually read (0 for
end of file, -1 for error). */
ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
const voidp buf, unsigned len));
/*
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of uncompressed bytes actually written
(0 in case of error).
*/
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
/*
Converts, formats, and writes the args to the compressed file under
control of the format string, as in fprintf. gzprintf returns the number of
uncompressed bytes actually written (0 in case of error).
*/
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
/*
Writes the given null-terminated string to the compressed file, excluding
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
/*
Reads bytes from the compressed file until len-1 characters are read, or
a newline character is read and transferred to buf, or an end-of-file
condition is encountered. The string is then terminated with a null
character.
gzgets returns buf, or Z_NULL in case of error.
*/
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
/*
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function. The return value is the zlib
error number (see function gzerror below). gzflush returns Z_OK if
the flush parameter is Z_FINISH and all output could be flushed.
gzflush should be called only when strictly necessary because it can
degrade compression.
*/
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
z_off_t offset, int whence));
/*
Sets the starting position for the next gzread or gzwrite on the
given compressed file. The offset represents a number of bytes in the
uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
If the file is opened for reading, this function is emulated but can be
extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
*/
ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
/*
Rewinds the given file. This function is supported only for reading.
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
*/
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
/*
Returns the starting position for the next gzread or gzwrite on the
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
*/
ZEXTERN int ZEXPORT gzeof OF((gzFile file));
/*
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state. The return value is the zlib
error number (see function gzerror below).
*/
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
Returns the error message for the last error which occurred on the
given compressed file. errnum is set to zlib error number. If an
error occurred in the file system and not in the compression library,
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
/* checksum functions */
/*
These functions are not related to compression but are exported
anyway because they might be useful in applications using the
compression library.
*/
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
return the updated checksum. If buf is NULL, this function returns
the required initial value for the checksum.
An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
much faster. Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
adler = adler32(adler, buffer, length);
}
if (adler != original_adler) error();
*/
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
Update a running crc with the bytes buf[0..len-1] and return the updated
crc. If buf is NULL, this function returns the required initial value
for the crc. Pre- and post-conditioning (one's complement) is performed
within this function so it shouldn't be done by the application.
Usage example:
uLong crc = crc32(0L, Z_NULL, 0);
while (read_buffer(buffer, length) != EOF) {
crc = crc32(crc, buffer, length);
}
if (crc != original_crc) error();
*/
/* various hacks, don't look :) */
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
const char *version, int stream_size));
ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
const char *version, int stream_size));
ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
int windowBits, int memLevel,
int strategy, const char *version,
int stream_size));
ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
#define deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, sizeof(z_stream))
#define inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
struct internal_state {int dummy;}; /* hack for buggy compilers */
#endif
ZEXTERN const char * ZEXPORT zError OF((int err));
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
#ifdef __cplusplus
}
#endif
#endif /* _ZLIB_H */

View File

@ -0,0 +1,72 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON DISCARDABLE "icon1.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -0,0 +1,178 @@
# Microsoft Developer Studio Project File - Name="bcrypt" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=bcrypt - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "bcrypt.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "bcrypt.mak" CFG="bcrypt - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "bcrypt - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "bcrypt - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "bcrypt - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /W3 /GX /O2 /I "..\\" /I ".\DLLs" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\\" /libpath:".\DLLs"
!ELSEIF "$(CFG)" == "bcrypt - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "..\\" /I ".\DLLs" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\\" /libpath:".\DLLs"
!ENDIF
# Begin Target
# Name "bcrypt - Win32 Release"
# Name "bcrypt - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\blowfish.c
# End Source File
# Begin Source File
SOURCE=..\endian.c
# End Source File
# Begin Source File
SOURCE=.\getopt.c
# End Source File
# Begin Source File
SOURCE=..\keys.c
# End Source File
# Begin Source File
SOURCE=..\main.c
# End Source File
# Begin Source File
SOURCE=..\rwfile.c
# End Source File
# Begin Source File
SOURCE=..\wrapbf.c
# End Source File
# Begin Source File
SOURCE=..\wrapzl.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\blowfish.h
# End Source File
# Begin Source File
SOURCE=..\config.h
# End Source File
# Begin Source File
SOURCE=..\defines.h
# End Source File
# Begin Source File
SOURCE=..\functions.h
# End Source File
# Begin Source File
SOURCE=.\getopt.h
# End Source File
# Begin Source File
SOURCE=..\includes.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\icon1.ico
# End Source File
# Begin Source File
SOURCE=.\Script1.rc
# End Source File
# Begin Source File
SOURCE=.\DLLs\libz.lib
# End Source File
# End Group
# Begin Source File
SOURCE=..\License
# End Source File
# Begin Source File
SOURCE=..\Readme
# End Source File
# Begin Source File
SOURCE=".\readme-win32.txt"
# End Source File
# End Target
# End Project

View File

@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "bcrypt"=.\bcrypt.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@ -0,0 +1,177 @@
//GETOPT.C
/*****************************************************************************
*
* MODULE NAME : GETOPT.C
*
* COPYRIGHTS:
* This module contains code made available by IBM
* Corporation on an AS IS basis. Any one receiving the
* module is considered to be licensed under IBM copyrights
* to use the IBM-provided source code in any way he or she
* deems fit, including copying it, compiling it, modifying
* it, and redistributing it, with or without
* modifications. No license under any IBM patents or
* patent applications is to be implied from this copyright
* license.
*
* A user of the module should understand that IBM cannot
* provide technical support for the module and will not be
* responsible for any consequences of use of the program.
* * Any notices, including this one, are not to be removed
* from the module without the prior written consent of
* IBM.
*
* AUTHOR: Original author:
* G. R. Blair (BOBBLAIR at AUSVM1)
* Internet: bobblair@bobblair.austin.ibm.com
*
* Extensively revised by:
* John Q. Walker II, Ph.D. (JOHHQ at RALVM6)
* Internet: johnq@ralvm6.vnet.ibm.com
*
*****************************************************************************/
/******************************************************************************
* getopt()
*
* The getopt() function is a command line parser. It returns the next
* option character in argv that matches an option character in opstring.
*
* The argv argument points to an array of argc+1 elements containing argc
* pointers to character strings followed by a null pointer.
*
* The opstring argument points to a string of option characters; if an
* option character is followed by a colon, the option is expected to have
* an argument that may or may not be separated from it by white space.
* The external variable optarg is set to point to the start of the option
* argument on return from getopt().
*
* The getopt() function places in optind the argv index of the next argument
* to be processed. The system initializes the external variable optind to
* 1 before the first call to getopt().
*
* When all options have been processed (that is, up to the first nonoption
* argument), getopt() returns EOF. The special option "--" may be used to
* delimit the end of the options; EOF will be returned, and "--" will be
* skipped.
*
* The getopt() function returns a question mark (?) when it encounters an
* option character not included in opstring. This error message can be
* disabled by setting opterr to zero. Otherwise, it returns the option
* character that was detected.
*
* If the special option "--" is detected, or all options have been
* processed, EOF is returned.
*
* Options are marked by either a minus sign (-) or a slash (/).
*
* No errors are defined.
*****************************************************************************/
#include <stdio.h> /* for EOF */
#include <string.h> /* for strchr() */
/* static (global) variables that are specified as exported by getopt() */
char *optarg = NULL; /* pointer to the start of the option argument */
int optind = 1; /* number of the next argv[] to be evaluated */
int opterr = 1; /* non-zero if a question mark should be returned
when a non-valid option character is detected */
/* handle possible future character set concerns by putting this in a macro */
#define _next_char(string) (char)(*(string+1))
int getopt(int argc, char *argv[], char *opstring)
{
static char *pIndexPosition = NULL; /* place inside current argv string */
char *pArgString = NULL; /* where to start from next */
char *pOptString; /* the string in our program */
if (pIndexPosition != NULL) {
/* we last left off inside an argv string */
if (*(++pIndexPosition)) {
/* there is more to come in the most recent argv */
pArgString = pIndexPosition;
}
}
if (pArgString == NULL) {
/* we didn't leave off in the middle of an argv string */
if (optind >= argc) {
/* more command-line arguments than the argument count */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* used up all command-line arguments */
}
/*---------------------------------------------------------------------
* If the next argv[] is not an option, there can be no more options.
*-------------------------------------------------------------------*/
pArgString = argv[optind++]; /* set this to the next argument ptr */
if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */
('-' != *pArgString)) {
--optind; /* point to current arg once we're done */
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* used up all the command-line flags */
}
/* check for special end-of-flags markers */
if ((strcmp(pArgString, "-") == 0) ||
(strcmp(pArgString, "--") == 0)) {
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return EOF; /* encountered the special flag */
}
pArgString++; /* look past the / or - */
}
if (':' == *pArgString) { /* is it a colon? */
/*---------------------------------------------------------------------
* Rare case: if opterr is non-zero, return a question mark;
* otherwise, just return the colon we're on.
*-------------------------------------------------------------------*/
return (opterr ? (int)'?' : (int)':');
}
else if ((pOptString = strchr(opstring, *pArgString)) == 0) {
/*---------------------------------------------------------------------
* The letter on the command-line wasn't any good.
*-------------------------------------------------------------------*/
optarg = NULL; /* no argument follows the option */
pIndexPosition = NULL; /* not in the middle of anything */
return (opterr ? (int)'?' : (int)*pArgString);
}
else {
/*---------------------------------------------------------------------
* The letter on the command-line matches one we expect to see
*-------------------------------------------------------------------*/
if (':' == _next_char(pOptString)) { /* is the next letter a colon? */
/* It is a colon. Look for an argument string. */
if ('\0' != _next_char(pArgString)) { /* argument in this argv? */
optarg = &pArgString[1]; /* Yes, it is */
}
else {
/*-------------------------------------------------------------
* The argument string must be in the next argv.
* But, what if there is none (bad input from the user)?
* In that case, return the letter, and optarg as NULL.
*-----------------------------------------------------------*/
if (optind < argc)
optarg = argv[optind++];
else {
optarg = NULL;
return (opterr ? (int)'?' : (int)*pArgString);
}
}
pIndexPosition = NULL; /* not in the middle of anything */
}
else {
/* it's not a colon, so just return the letter */
optarg = NULL; /* no argument follows the option */
pIndexPosition = pArgString; /* point to the letter we're on */
}
return (int)*pArgString; /* return the letter that matched */
}
}

View File

@ -0,0 +1,38 @@
/*****************************************************************************
*
* MODULE NAME : GETOPT.H
*
* COPYRIGHTS:
* This module contains code made available by IBM
* Corporation on an AS IS basis. Any one receiving the
* module is considered to be licensed under IBM copyrights
* to use the IBM-provided source code in any way he or she
* deems fit, including copying it, compiling it, modifying
* it, and redistributing it, with or without
* modifications. No license under any IBM patents or
* patent applications is to be implied from this copyright
* license.
*
* A user of the module should understand that IBM cannot
* provide technical support for the module and will not be
* responsible for any consequences of use of the program.
*
* Any notices, including this one, are not to be removed
* from the module without the prior written consent of
* IBM.
*
* AUTHOR: Original author:
* G. R. Blair (BOBBLAIR at AUSVM1)
* Internet: bobblair@bobblair.austin.ibm.com
*
* Extensively revised by:
* John Q. Walker II, Ph.D. (JOHHQ at RALVM6)
* Internet: johnq@ralvm6.vnet.ibm.com
*
*****************************************************************************/
extern char * optarg;
extern int optind;
int getopt ( int argc, char **argv, char *optstring);

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@ -0,0 +1,16 @@
To run the program, make sure the bcrypt.exe and zlib.dll files are
in the same directory. It will also work if zlib.dll is located
elsewhere, but still in the path. The win32 native version behaves
slightly differently, in that it doesn't hide the passphrase as you
type it in. Otherwise, it's functionally identical to Un*x native
code.
ZLib for Win32 obtained from the GnuWin32 project at:
http://sourceforge.net/project/showfiles.php?group_id=23617
Download zlib-1.1.4-bin.zip to get the .dll.
If you plan on compiling from source, download zlib-1.1.4-bin.zip to
get the .dll, and zlib-1.1.4-lib.zip to get the include files. Place
the .dll file in the win32console directory, and everything should
work perfectly from within the Visual Studio environment.

View File

@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Script1.rc
//
#define IDI_ICON1 101
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

6
3rdparty/phptest.php vendored Normal file
View File

@ -0,0 +1,6 @@
<?php
$b = '$2y$10$hPnrtXL/7lSmwYW5c03XB.6WLaxRRmBUYq8sRxGyExApoTzTjI8mi';
$c = '$2y$10$OSHXWhG2UjDkQUzhT1nFTeFnDzoYjPzpO9Uy9736LTkgMAUZyJw9q';
var_dump( password_verify('password',$c) );
var_dump( password_needs_rehash($c, PASSWORD_BCRYPT, array('cost' => 10) ) );
print password_hash('password',PASSWORD_BCRYPT) . PHP_EOL;

48
CMakeLists.txt Normal file
View File

@ -0,0 +1,48 @@
cmake_minimum_required(VERSION 3.0)
project(hathor)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckLibraryExists)
include(CheckFunctionExists)
check_include_files(libintl.h HAVE_LIBINTL_H)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.58.0 COMPONENTS system filesystem)
if(NOT Boost_FOUND)
message( SEND_ERROR "One or more boost libraries were not found. If you have boost installed check that it is version 1.58 or above." )
endif()
find_package(PkgConfig)
pkg_check_modules(TAGLIB23 REQUIRED taglib)
#find_package(mysqlcppconn 1.0)
#pkg_check_modules(MYSQL QUIET libmysqlcppconn-1.0)
#pkg_check_modules(MYSQL REQUIRED mysqlcppconn-1.0)
#CHECK_LIBRARY_EXISTS(pipecolors pcprintf "/usr/lib" PIPE)
find_library(MYSQLCONNECTORCPP_LIBRARY
NAMES
mysqlcppconn
mysqlcppconn-static
HINTS
"/usr/lib"
PATH_SUFFIXES
lib)
if(NOT MYSQLCONNECTORCPP_LIBRARY)
message( SEND_ERROR "Oracle's mysqlconnector lib is required.")
else()
message(STATUS "Found libmysqlcppconn")
endif()
set(SOURCE_FILES
mysql.cc
config.cc
common.cc
scanner.cc
3rdparty/crypt_blowfish.c
)
add_executable(scanner ${SOURCE_FILES})
TARGET_LINK_LIBRARIES(scanner "-lboost_system -lboost_filesystem -ltag -lmysqlcppconn")

340
LICENSE Normal file
View File

@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

3
Makefile Normal file
View File

@ -0,0 +1,3 @@
all:
g++ -o scanner mysql.cc config.cc common.cc scanner.cc -lboost_system -lboost_filesystem -ltag -lcrypt -lssl -lcrypto -std=c++11 -lmysqlcppconn

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# hathor
Local Music API

3
app/core/api/.htaccess Normal file
View File

@ -0,0 +1,3 @@
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]

186
app/core/api/Hathor.php Normal file
View File

@ -0,0 +1,186 @@
<?php
/**
* Created by PhpStorm.
* User: eric
* Date: 8/22/15
* Time: 6:36 PM
*/
namespace Hathor;
class Hathor
{
public function __construct() {
}
}
class Format extends Hathor
{
/**
*
*/
public function __construct() {
parent::__construct();
return true;
}
/**
*
*/
public function __destruct() {
return true;
}
/**
*
*/
public function __toString() {
return "This is neat";
}
/**
* @param $size
* @return string
* @throws \InvalidArgumentException
*/
public static function tokb( $size ) {
if( is_numeric($size) ):
return sprintf('%.02fk', $size / 1024 );
else:
throw new \InvalidArgumentException('Must be an int in function tokb( int $size )!');
endif;
}
/**
* [tomb description]
* @param int $size [description]
* @return string [description]
* @throws \InvalidArgumentException [<description>]
*/
public function tomb( $size ) {
if( is_numeric($size) ):
return sprintf('%.02fmb', ($size / 1024) / 1024 );
else:
throw new \InvalidArgumentException('Must be an int in function tomb( int $size)!');
endif;
}
/**
* @param $size
* @return string
*/
public function togb( $size ) {
return sprintf('%.02fgb', ( ($size / 1024) / 1024 ) / 1024 );
}
/**
* @param array $array
* @param bool|false $jpp
* @return string
* @throws \InvalidArgumentException
*/
public static function tojson(array $array, $jpp = false)
{
if (!is_array ($array)):
throw new \InvalidArgumentException;
elseif (is_object ($array)):
$array = (array)$array;
endif;
if($jpp):
return json_encode ($array, JSON_NUMERIC_CHECK | JSON_PRESERVE_ZERO_FRACTION | JSON_PRETTY_PRINT );
else:
return json_encode ($array, JSON_NUMERIC_CHECK | JSON_PRESERVE_ZERO_FRACTION );
endif;
}
}
/**
* Class Connection
* @package Hathor
* @description
* Small class to connect to the database
*/
use \Slim\PDO\Database;
class Connection extends Database {
private $dsn;
/**
* @param none
* @description
* Get database information from configuration
* and setup the PDO connection
* @return \Slim\PDO\Database connection
*/
public function __construct() {
global $config;
$this->dsn = sprintf('mysql:host=%s;dbname=%s;charset=utf8', $config->db['host'], $config->db['db']);
return parent::__construct($this->dsn, $config->db['user'], $config->db['pass']);
}
public function __toString() {
return $this->dsn;
}
public function __destruct() {
unset($this);
}
}
/**
* Class Log
* @package Hathor
*/
class Log extends Hathor {
public function write($message) {
var_dump($message);
}
}
/**
* Class DefaultHeaders *
* @package Hathor
* @description
* Middleware to set default headers that
* we want on every request.
*/
use \Slim\Middleware;
class DefaultHeaders extends Middleware
{
private $strln;
public function call()
{
global $config;
$defaults = [
'X-Powered-By' => 'SlimPHP/2, Hathor Music Api/1.0 (gentoo)',
'X-Hathor-Version' => '1.0/gentoo',
'Allow' => 'GET, HEAD, OPTIONS',
'Content-Language' => 'en',
'Content-Type' => 'application/json; charset=utf-8',
'Server' => 'Hathor Music Api/1.0 (gentoo)',
'X-XSS-Prottection' => '1; mode=block',
'ETag' => md5(time())
];
$env = $this->app->environment;
$env['slim.errors'] = fopen($config->logs['error'], 'w');
// Loop through default headers we want set on every response and set them.
foreach($defaults as $headerKey => $headerVal):
$this->app->response->headers->set($headerKey, $headerVal);
endforeach;
// Run inner middleware and application
$this->next->call();
// Set the Content-Length + 1
$this->strln = strlen($this->app->response->getBody());
// Check if it is head. If it is we don't want any content length.
$this->strln = $this->app->request->isHead() ? 0 : $this->strln;
// Set the Content-Length header
$this->app->response->headers->set('Content-Length', $this->strln);
}
}

221
app/core/api/index.php Normal file
View File

@ -0,0 +1,221 @@
<?php
require __DIR__ . '/../bootstrap.php';
function hathor_home() {
$artists = get_artists();
$length = count($artists);
$ret['status'] = 200;
$ret['count'] = $length;
$ret['response'] = $artists;
$app = \Slim\Slim::getInstance();
$app->response->setBody( \Hathor\Format::tojson($ret) );
}
function hathor_get_error($type = HATHOR_NO_RESULTS) {
// print_r(json_decode('{"errors":[{"code":215,"message":"Bad Authentication data."}]}'));
$error['errors'][] = [
'code' => 404,
'message' => 'No results found.'
];
return \Hathor\Format::tojson($error);
}
function hathor_years_get_options() {
$return['GET'][] =
[
'int' => 'year',
'description' => 'The year of the album'
];
return \Hathor\Format::tojson($return, true);
}
$app->get('/track/play/:tid', function($tid) use ($app) {
$track = get_track($tid);
$app->response->headers->set('Content-Type', 'audio/mpeg');
$app->response->setBody( file_get_contents( $track['uri'] ) );
/*$content = base64_encode( file_get_contents( $track['uri'] ) );
if( file_exists( dirname($track['uri']) . DIRECTORY_SEPARATOR . 'album.jpg' ) ):
$albumart = base64_encode( file_get_contents( dirname($track['uri']) . DIRECTORY_SEPARATOR . 'album.jpg' ) );
else:
$albumart = base64_encode( file_get_contents( 'http://placekitten.com/120/121' ) );
endif;
print sprintf('<img src="data:image/jpeg;base64,%s" />', $albumart);
print sprintf('<audio id="player" src="data:audio/mpeg;base64,%s" controls preload="auto" autobuffer></audio>', $content);
*/
}
);
function get_track($tid) {
global $config;
$pdo = new Hathor\Connection();
//get_connection($config['db']);
$selectStatement = $pdo->select()
->from('tracks')
->where('tid','=', $tid);
$stmt = $selectStatement->execute();
$ret = $stmt->fetch();
close_connection($pdo);
return $ret;
}
function hathor_get_album($aid) {
$app = \Slim\Slim::getInstance();
global $config;
$album = get_album($aid);
$request = $app->request;
$res = $app->response;
$res->headers->set('Content-Type', 'application/json');
$res->setStatus(200);
if($request->isOptions()):
$res->headers->set('Allow', 'GET, OPTIONS');
$res->setBody("200 OK\nAllow: GET,OPTIONS\n");
else:
$json['status'] = 200;
foreach($config->defaults['cover_files'] as $cover):
if( file_exists( dirname($album[0]['uri']) . DIRECTORY_SEPARATOR . $cover ) ):
$albumcover = dirname($album[0]['uri']) . DIRECTORY_SEPARATOR . $cover;
break;
else:
continue;
endif;
endforeach;
if(isset($albumcover)):
$meta = getimagesize($albumcover, $info);
$meta = array(
'width' => $meta[0],
'height'=> $meta[1],
'bits' => isset($meta['bits']) ? $meta['bits'] : null,
'mime' => isset($meta['mime']) ? $meta['mime'] : null,
'extra' => empty($info) ? null : $info
);
$cover = array(
'base64' => base64_encode( file_get_contents( $albumcover ) ),
'uri' => $albumcover,
'size' => \Hathor\Format::tokb( filesize($albumcover) ),
'meta' => $meta
);
else:
$meta = getimagesize(__DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg', $info);
$meta = array(
'width' => $meta[0],
'height'=> $meta[1],
'bits' => isset($meta['bits']) ? $meta['bits'] : null,
'mime' => isset($meta['mime']) ? $meta['mime'] : null,
'extra' => empty($info) ? null : $info
);
$cover = array(
'base64' => base64_encode( file_get_contents( __DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg' ) ),
'uri' => $request->getResourceUri(),
'size' => filesize(__DIR__ . DIRECTORY_SEPARATOR . '../images/album.jpg'),
'meta' => $meta
);
endif;
foreach($album as $track):
$tr[ $track['track'] ] = array(
'tid' => $track['tid'],
'title' => $track['title'],
'genre' => $track['genre'],
'track' => $track['track'],
'length' => $track['length'],
'playtime' => sprintf('%d:%02d',$track['minutes'], $track['seconds']),
'size' => sprintf('%.02f MB', ( filesize($track['uri']) / 1024 ) / 1024 )
);
endforeach;
$json['response'] = array(
'artist' => $album[0]['artist'],
'arid' => $album[0]['arid'],
'album' => $album[0]['album'],
'aid' => $album[0]['aid'],
'cover' => $cover,
'total' => count($tr),
'tracks' => $tr
);
$res->setBody( json_encode($json) );
endif;
}
function get_album($aid) {
global $config;
$pdo = new Hathor\Connection();//get_connection($config['db']);
$selectStatement = $pdo->select(
array('tid','title','track','arid','artist','aid','album','year','genre','label','minutes','seconds','length','uri')
)
->distinct()
->groupBy('tid')
->orderBy('track', 'ASC')
->from('tracks')
->where('aid','=',$aid);
$stmt = $selectStatement->execute();
$ret = $stmt->fetchAll();
close_connection($pdo);
return $ret;
}
$app->get('/artist/:arid', function ($arid) use($app) {
$app->response->headers()->set('Content-Type','application/json');
$app->response->setBody(json_encode(get_artist($arid)));
})->conditions( array('id' => '[\w\d]+') );
function get_artist($arid) {
global $config;
$pdo = new Hathor\Connection();
$selectStatement = $pdo->select(
array('arid','artist')
)
//->distinct()
->groupby('arid')
->from('artists')
->where('arid','=',$arid);
$stmt = $selectStatement->execute();
$ret = $stmt->fetchAll();
close_connection($pdo);
return $ret;
}
function get_artists() {
global $config;
$test = new \Hathor\Connection();
$pdo = new Hathor\Connection();
$selectStatement = $pdo->select(array('name','arid'))
->orderBy('name')
->from('artists');
$stmt = $selectStatement->execute();
$ret = $stmt->fetchAll();
close_connection($pdo);
return $ret;
}
function get_years() {
}
function close_connection(\Slim\PDO\Database $db) {
$db = null;
return true;
}
$app->run();

30
app/core/bootstrap.php Normal file
View File

@ -0,0 +1,30 @@
<?php
/*
* @file bootstrap.php
* @description Load defaults
*
*/
define('HATHOR_NO_RESULTS', 1363);
define('HATHOR_PARTIAL', 1364);
require __DIR__ . '/../3rdparty/autoload.php';
require __DIR__ . '/config.php';
require __DIR__ . '/api/Hathor.php';
$app = new \Slim\Slim(array(
'debug' => true,
'mode' => 'development',
'log.writer' => new Hathor\Log,
'log.enabled' => true,
'log.level' => \Slim\Log::DEBUG,
));
$app->add(new \Hathor\DefaultHeaders());
require __DIR__ . '/routes.php';
$app->setName('hwt-thr');
$app->container->singleton('format', function () {
return new \Hathor\Format();
});

52
app/core/config.php Normal file
View File

@ -0,0 +1,52 @@
<?php
/**
* config.php
*
* Copyright 2015 R. Eric Wheeler <eric@rewiv.com>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*
**/
require_once( __DIR__ . DIRECTORY_SEPARATOR . basename('bootstrap.php', '.php') . '.php');
if( isset( $_SERVER['HTTP_REFERER'] ) ):
header("Location: /", 401);
endif;
$config = new stdClass();
$config->db = array(
'host' => 'localhost',
'db' => 'hathor_music',
'port' => 3306,
'user' => 'root',
'pass' => '123'
);
$config->defaults['cover_files'] = array(
'folder.jpg',
'folder.jpeg',
'artist.jpg',
'artist.jpeg',
'album.jpg',
'album.jpeg'
);
$config->logs = [
'error' => '/home/eric/code/hathor/app/hathor.err',
'access' => '/home/eric/code/hathor/app/hathor.log'
];

BIN
app/core/images/album.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
app/core/images/album.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

74
app/core/newhathor.sql Normal file
View File

@ -0,0 +1,74 @@
-- MySQL dump 10.13 Distrib 5.6.26, for Linux (x86_64)
--
-- Host: localhost Database: hathor
-- ------------------------------------------------------
-- Server version 5.6.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `hathor`
--
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `hathor` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `hathor`;
--
-- Table structure for table `tracks`
--
DROP TABLE IF EXISTS `tracks`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tracks` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id of the song in the database',
`tid` varchar(64) NOT NULL COMMENT 'song id md5 hash',
`uri` varchar(1000) NOT NULL COMMENT 'full path of file',
`arid` varchar(64) NOT NULL COMMENT 'corresponding artist id from artist table in md5 hash',
`artist` varchar(255) NOT NULL COMMENT 'artist name',
`aid` varchar(64) NOT NULL COMMENT 'corresponding album id from album table in md5 hash',
`album` varchar(255) NOT NULL COMMENT 'album title',
`title` varchar(255) NOT NULL COMMENT 'title of song',
`track` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'track number of song',
`genre` varchar(45) DEFAULT NULL COMMENT 'genre of song',
`year` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'year of song',
`label` varchar(255) DEFAULT NULL COMMENT 'music label of song e.g. Columbia Records',
`lyrics` blob COMMENT 'lyrics if any',
`bitrate` mediumint(6) unsigned DEFAULT '0' COMMENT 'bitrate of song',
`sample` mediumint(6) unsigned DEFAULT '0' COMMENT 'sample rate of song',
`channels` smallint(2) unsigned DEFAULT '0' COMMENT 'channels of song i.e stereo = 2, mono = 1',
`length` int(10) unsigned DEFAULT '0' COMMENT 'length of song',
`minutes` tinyint(4) unsigned DEFAULT '0' COMMENT 'total length of song in minutes and seconds',
`seconds` tinyint(4) unsigned DEFAULT '0' COMMENT 'seconds of song',
`pls` blob COMMENT 'playlists this song is associated with',
`ts` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp of last update of song',
PRIMARY KEY (`id`),
UNIQUE KEY `tid_UNIQUE` (`tid`),
KEY `tid_idx` (`tid`),
KEY `uri_idx` (`uri`(255)),
KEY `arid_idx` (`arid`),
KEY `aid_idx` (`aid`),
KEY `track_idx` (`track`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2015-08-17 7:55:50

64
app/core/routes.php Normal file
View File

@ -0,0 +1,64 @@
<?php
/*
* @file routes.php
* @description
* Contains all the api routes
*/
$app->map('/', 'hathor_home')->via('GET','HEAD','OPTIONS');
//$app->get('/artists', 'hathor_get_artists')->via('GET', 'HEAD', 'OPTIONS');
//$app->get('/artist/:arid', 'hathor_get_artist')->via('GET', 'HEAD', 'OPTIONS');
//$app->get('/albums', 'hathor_get_albums')->via('GET', 'HEAD', 'OPTIONS');
$app->map('/album/:aid', 'hathor_get_album')->conditions( array('id' => '[\w\d]+') )->via('GET', 'HEAD', 'OPTIONS');
$app->map('/album/cover/:cid', 'hathor_get_cover')->via('GET','HEAD','OPTIONS');
function hathor_get_cover() {
return true;
}
/**
* /artists
* /artists/{arid}
* /artists/{arid}/albums
* /artists/{arid}/albums/{aid}
* /artists/{arid}/albums/{aid}/tracks
* /artists/{arid}/albums/{arid}/tracks/{tid}
* /artists/{arid}/albums/{arid}/tracks/{tid}/play
* /artists/{arid}/albums/{arid}/tracks/{tid}/download
*/
/**
* /albums
* /albums/{aid}
* /albums/{aid}/tracks
* /albums/{aid}/tracks/{tid}
* /albums/{aid}/tracks/{tid}/play
* /albums/{aid}/tracks/{tid}/download
*/
/**
* /tracks
* /tracks/{tid}
* /tracks/{tid}/play
* /tracks/{tid}/download
*/
/**
* /years
* /years/{year}
*/
/**
* /users
* /users/{uid}
* /users/{uid}/playlists
* /users/{uid}/playlists/{plid}
*/
/**
* /playlists
* /playlists/{plid}
*/

10
app/exception.php Normal file
View File

@ -0,0 +1,10 @@
<?php
function tokb(array $size ) {
}
try {
tokb( 2 );
} catch(\Exception $e) {
print_r($e);
}

6
app/id3.php Normal file
View File

@ -0,0 +1,6 @@
<?php
require_once '3rdparty/autoload.php';
$id3 = new getID3;
$id3->setOption(array('encoding' => 'UTF-8'));
$file = $id3->analyze('/home/eric/code/hathor/tests/Bob Dylan.Bringing It All Back Home.01.Subterranean Homesick Blues.mp3');
echo '<pre>'. print_r($file, true) .'</pre>';

0
app/index.html Normal file
View File

35
bcrypt.cc Normal file
View File

@ -0,0 +1,35 @@
#include <cstdlib>
#include <cstdio>
#include <openssl/blowfish.h>
#include <cstring>
#include <iostream>
#define SIZE 64
int main()
{
unsigned char* in = (unsigned char *)"TestData";
unsigned char* out = (unsigned char*) calloc(SIZE+1, sizeof(char));
unsigned char* out2 = (unsigned char*) calloc(SIZE+1, sizeof(char));
//pData = (int*) calloc (i,sizeof(int));
BF_KEY *key = (BF_KEY*) calloc(1, sizeof(BF_KEY));
std::string result;
/* set up a test key */
BF_set_key(key, SIZE, (const unsigned char*)"TestKey!" );
/* test out encryption */
char buf[sizeof(BF_KEY)];
BF_ecb_encrypt(in, out, key, BF_ENCRYPT);
for(int i=0;i<sizeof(BF_KEY); i++) {
sprintf(buf, "%c", out[i]);
result.append( buf );
}
printf("%s\n", result.c_str());
/* test out decryption */
BF_ecb_encrypt(out, out2, key, BF_DECRYPT);
printf("%s\n", out2);
free(out);
free(out2);
free(key);
return 0;
}

77
common.cc Normal file
View File

@ -0,0 +1,77 @@
#include "common.hh"
#define BCRYPT_HASHSIZE (64)
#define RANDBYTES (16)
#define COST (12)
using namespace std;
int getch() {
struct termios oldt,
newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}
std::string getPass( const char * prompt = "Enter Password : ", char h_ch = '*') {
std::string pass;
char ch;
cout << prompt;
while ( ch != '\n' ) {
ch = getch();
if(ch == 127 || ch == 8 ) {
if( !pass.empty() ) {
cout << "\b \b";
pass.pop_back();
}
} else {
pass.push_back(ch);
if(pass.front() == '\n') { cout << "\nPassword required. Exiting ...\n" << endl; exit(EXIT_FAILURE); }
cout << h_ch;
}
}
pass.pop_back();
cout << endl;
return pass;
}
inline bool is_empty_string(const std::string s) {
return true;
}
void toLower(std::string &str)
{
const int length = str.length();
for(int i=0; i < length; ++i)
{
str[i] = std::tolower(str[i]);
}
}
inline bool file_exists (const std::string& name) {
struct stat buffer;
return (stat (name.c_str(), &buffer) == 0);
}
bool is_hidden(const boost::filesystem::path &p)
{
boost::filesystem::path::string_type name = p.filename().native();
if(name != ".." &&
name != "." &&
name[0] == '.')
{
return true;
}
return false;
}

22
common.hh Normal file
View File

@ -0,0 +1,22 @@
#ifndef HATHOR_COMMON_HH
#define HATHOR_COMMON_HH
#include <sys/stat.h>
#include <cstdlib>
#include <termios.h>
#include <crypt.h>
#include <openssl/md5.h>
// Include boost
#include "boost/filesystem.hpp"
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/progress.hpp"
#include "boost/lexical_cast.hpp"
int getch();
std::string getPass( const char * prompt, char h_ch);
inline bool is_empty_string(const std::string s);
bool is_hidden(const boost::filesystem::path &p);
void toLower( std::string &str );
#endif

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5553
components/require-built.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,24 @@
var components = {
"packages": [
{
"name": "jplayer",
"main": "jplayer-built.js"
}
],
"shim": {
"jplayer": {
"deps": [
"jquery"
]
}
},
"baseUrl": "components"
};
if (typeof require !== "undefined" && require.config) {
require.config(components);
} else {
var require = components;
}
if (typeof exports !== "undefined" && typeof module !== "undefined") {
module.exports = components;
}

0
components/require.css Normal file
View File

Some files were not shown because too many files have changed in this diff Show More