X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..07691282a056c4efea71e1e505527601e8cc166b:/OSX/libsecurity_smime/lib/cmsencdata.c diff --git a/OSX/libsecurity_smime/lib/cmsencdata.c b/OSX/libsecurity_smime/lib/cmsencdata.c index 895b5085..7dea92a2 100644 --- a/OSX/libsecurity_smime/lib/cmsencdata.c +++ b/OSX/libsecurity_smime/lib/cmsencdata.c @@ -61,7 +61,9 @@ SecCmsEncryptedDataCreate(SecCmsMessageRef cmsg, SECOidTag algorithm, int keysiz void *mark; SecCmsEncryptedDataRef encd; PLArenaPool *poolp; +#if 0 SECAlgorithmID *pbe_algid; +#endif OSStatus rv; poolp = cmsg->poolp; @@ -87,10 +89,11 @@ SecCmsEncryptedDataCreate(SecCmsMessageRef cmsg, SECOidTag algorithm, int keysiz /* Assume password-based-encryption. At least, try that. */ #if 1 // @@@ Fix me - pbe_algid = NULL; + rv = SECFailure; + break; #else pbe_algid = PK11_CreatePBEAlgorithmID(algorithm, 1, NULL); -#endif + if (pbe_algid == NULL) { rv = SECFailure; break; @@ -98,6 +101,7 @@ SecCmsEncryptedDataCreate(SecCmsMessageRef cmsg, SECOidTag algorithm, int keysiz rv = SecCmsContentInfoSetContentEncAlgID((SecArenaPoolRef)poolp, &(encd->contentInfo), pbe_algid, keysize); SECOID_DestroyAlgorithmID (pbe_algid, PR_TRUE); break; +#endif } if (rv != SECSuccess) goto loser; @@ -116,6 +120,9 @@ loser: void SecCmsEncryptedDataDestroy(SecCmsEncryptedDataRef encd) { + if (encd == NULL) { + return; + } /* everything's in a pool, so don't worry about the storage */ SecCmsContentInfoDestroy(&(encd->contentInfo)); return;