X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b04fe171f0375ecd5d8a24747ca1dff85720a0ca..6b200bc335dc93c5516ccb52f14bd896d8c7fad7:/SecurityTests/clxutils/clAppUtils/BlobList.cpp?ds=sidebyside diff --git a/SecurityTests/clxutils/clAppUtils/BlobList.cpp b/SecurityTests/clxutils/clAppUtils/BlobList.cpp deleted file mode 100644 index 53bd05b4..00000000 --- a/SecurityTests/clxutils/clAppUtils/BlobList.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/*** BlobList class for managing groups of raw certs and CRLs ***/ - -#include "BlobList.h" -#include -#include -#include -#include -#include -#include - -BlobList::~BlobList() -{ - for(uint32 dex=0; dexLength = blob.Length; - dst->Data = (uint8 *)malloc(dst->Length); - memmove(dst->Data, blob.Data, dst->Length); - } - else { - *dst = blob; - } -} - - -int BlobList::addFile(const char *fileName, - const char *dirName /* = NULL */) -{ - CSSM_DATA blob; - int rtn; - char *fullName; - unsigned blobDataLen; - unsigned char *blobData; - - if(dirName) { - int len = strlen(dirName) + strlen(fileName) + 2; - fullName = (char *)malloc(len); - sprintf(fullName, "%s/%s", dirName, fileName); - } - else { - fullName = (char *)fileName; - } - rtn = cspReadFile(fullName, &blobData, &blobDataLen); - if(rtn) { - printf("***Error reading file %s\n", fullName); - if(dirName) { - free(fullName); - } - return rtn; - } - - /* convert from PEM to DER if appropriate */ - if(isPem(blobData, blobDataLen)) { - unsigned derDataLen; - unsigned char *derData; - - if(pemDecode(blobData, blobDataLen, &derData, &derDataLen)) { - printf("***Error PEM-decoding file %s; using as raw data\n", fileName); - blob.Data = blobData; - blob.Length = blobDataLen; - } - else { - blob.Data = derData; - blob.Length = derDataLen; - free(blobData); - } - } - else { - /* raw file data is the stuff we'll use */ - blob.Data = blobData; - blob.Length = blobDataLen; - } - addBlob(blob); - if(dirName) { - free(fullName); - } - return 0; -} -