* CMSDecoder.cpp - Interface for decoding CMS messages.
*/
-#include "CMSDecoder.h"
-#include "CMSPrivate.h"
+#include <Security/CMSDecoder.h>
+#include <Security/CMSPrivate.h>
#include "CMSUtils.h"
#include <../libsecurity_codesigning/lib/csutilities.h>
#include <Security/oidsattr.h>
#include <Security/SecTrustPriv.h>
#include <CoreFoundation/CFRuntime.h>
+#include <utilities/SecCFWrappers.h>
#include <pthread.h>
#include <syslog.h>
#include <AssertMacros.h>
SecTrustRef *secTrust, /* optional; RETURNED */
OSStatus *certVerifyResultCode) /* optional; RETURNED */
{
- if((cmsDecoder == NULL) || (cmsDecoder->decState != DS_Final) || (!policyOrArray)) {
+ if((cmsDecoder == NULL) || (cmsDecoder->decState != DS_Final) || (!policyOrArray) || !signerStatus) {
return errSecParam;
}
if(secTrust != NULL) {
*secTrust = theTrust;
/* we'll release our reference at the end */
- if (theTrust)
- CFRetain(theTrust);
+ CFRetainSafe(theTrust);
}
SecCmsSignerInfoRef signerInfo =
SecCmsSignedDataGetSignerInfo(cmsDecoder->signedData, (int)signerIndex);