X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/clxutils/extenGrab/extenGrab.cpp?ds=sidebyside diff --git a/SecurityTests/clxutils/extenGrab/extenGrab.cpp b/SecurityTests/clxutils/extenGrab/extenGrab.cpp deleted file mode 100644 index 01410d34..00000000 --- a/SecurityTests/clxutils/extenGrab/extenGrab.cpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - * extenGrab - write the unparsed extension blobs of a specified - * cert to files for external examination - */ -#include -#include -#include -#include -#include -#include -#include -#include - -static void usage(char **argv) -{ - printf("Usage: %s certFile outFileBase [r for CRL, default is cert]\n", - argv[0]); - exit(1); -} - -/* - * How many items in a NULL-terminated array of pointers? - */ -static unsigned nssArraySize( - const void **array) -{ - unsigned count = 0; - if (array) { - while (*array++) { - count++; - } - } - return count; -} - -int main(int argc, char **argv) -{ - if(argc < 3) { - usage(argv); - } - - bool doCert = true; - NSS_Certificate signedCert; - NSS_Crl signedCrl; - void *decodeTarget; - const SecAsn1Template *templ; - NSS_CertExtension ***extenp; - - for(int arg=3; argextnId.Data, exten->extnId.Length, oidStr); - printf("Extension %u : %s\n", dex, oidStr); - sprintf(outFileName, "%s_%u", outBase, dex); - if(writeFile(outFileName, exten->value.Data, exten->value.Length)) { - printf("***Error writing %s. Aborting.\n", - outFileName); - exit(1); - } - else { - printf("...wrote %lu bytes to %s\n", - exten->value.Length, outFileName); - } - } - SecAsn1CoderRelease(coder); - printf("..done.\n"); - return 0; -}