X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/72a12576750f52947eb043106ba5c12c0d07decf..b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195:/libsecurity_cryptkit/ckutils/blobtest/blobtest.c diff --git a/libsecurity_cryptkit/ckutils/blobtest/blobtest.c b/libsecurity_cryptkit/ckutils/blobtest/blobtest.c new file mode 100644 index 00000000..c76c0a47 --- /dev/null +++ b/libsecurity_cryptkit/ckutils/blobtest/blobtest.c @@ -0,0 +1,344 @@ +/* Copyright 1998 Apple Computer, Inc. + * + * blobtest.c - test key blob functions + * + * Revision History + * ---------------- + * 23 Mar 1998 Doug Mitchell + * Created. + */ + +#include "Crypt.h" +#include "falloc.h" +#include +#include +#include +#include "ckutilsPlatform.h" + +#define MIN_PASSWD_LENGTH 4 +#define MAX_PASSWD_LENGTH 20 +#define DEPTH_DEFAULT FEE_DEPTH_DEFAULT + +#undef BOOL +#undef YES +#undef NO +#define BOOL int +#define YES 1 +#define NO 0 + +static unsigned char *passwdPool; + +static unsigned doBlobTest(unsigned minPasswdLen, + unsigned maxPasswdLen, + BOOL verbose, + unsigned depth); +static void usage(char **argv); + +int main(int argc, char **argv) +{ + BOOL seedSpec = NO; // YES ==> user specified + unsigned loopNum; + int arg; + char *argp; + + /* + * User-spec'd variables + */ + unsigned minPasswordLen = MIN_PASSWD_LENGTH; + unsigned maxPasswordLen = MAX_PASSWD_LENGTH; + int seed = 0; + unsigned loops = 1; + BOOL quiet = NO; + BOOL verbose = NO; + unsigned depth = DEPTH_DEFAULT; + + #if macintosh + argc = ccommand(&argv); + #endif + for(arg=1; arg