#include <Security/cssmapple.h>
#include <assert.h>
-#define tpCredDebug(args...) debug("tpCred", ## args)
+#define tpCredDebug(args...) secdebug("tpCred", ## args)
/*
* Build up a CSSM_X509_NAME from an arbitrary list of name/OID pairs.
{
CSSM_X509_NAME *top = (CSSM_X509_NAME *)malloc(sizeof(CSSM_X509_NAME));
top->numberOfRDNs = numNames;
+ if(numNames == 0) {
+ /* legal! */
+ top->RelativeDistinguishedName = NULL;
+ return top;
+ }
top->RelativeDistinguishedName =
(CSSM_X509_RDN_PTR)malloc(sizeof(CSSM_X509_RDN) * numNames);
CSSM_X509_RDN_PTR rdn;
tpCredDebug("AppleTPSession::refKeyToRaw: context err");
CssmError::throwMe(crtn);
}
+
crtn = CSSM_WrapKey(ccHand,
&creds,
refKey,
*/
void AppleTPSession::SubmitCsrRequest(
const CSSM_TP_REQUEST_SET &RequestInput,
- const CSSM_TP_CALLERAUTH_CONTEXT *CallerAuthContext,
sint32 &EstimatedTime, // RETURNED
CssmData &ReferenceIdentifier) // RETURNED
{
(certReq->signatureOid.Data == NULL)) {
CssmError::throwMe(CSSMERR_TP_INVALID_REQUEST_INPUTS);
}
- if((certReq->subjectNames == NULL) ||
- (certReq->numSubjectNames == 0)) {
- CssmError::throwMe(CSSMERR_TP_INVALID_NAME);
- }
/* convert ref public key to raw per CL requirements */
const CSSM_KEY *subjectPubKey = certReq->certPublicKey;
CSSM_RETURN crtn;
crtn = CSSM_CSP_CreateSignatureContext(certReq->cspHand,
certReq->signatureAlg,
- (CallerAuthContext ? CallerAuthContext->CallerCredentials : NULL),
+ NULL, // AccessCred
certReq->issuerPrivateKey,
&sigHand);
if(crtn) {
if(tpCompareCssmData(&tpPolicy->PolicyIds->FieldOid,
&CSSMOID_APPLE_TP_CSR_GEN)) {
/* break out to CSR-specific code */
- SubmitCsrRequest(RequestInput, CallerAuthContext, EstimatedTime, ReferenceIdentifier);
+ SubmitCsrRequest(RequestInput, EstimatedTime, ReferenceIdentifier);
return;
}
else if(!tpCompareCssmData(&tpPolicy->PolicyIds->FieldOid,
(certReq->issuerPrivateKey == NULL)) {
CssmError::throwMe(CSSMERR_TP_INVALID_REQUEST_INPUTS);
}
- if((certReq->subjectNames == NULL) ||
- (certReq->numSubjectNames == 0)) {
- CssmError::throwMe(CSSMERR_TP_INVALID_NAME);
- }
if((certReq->numExtensions != 0) & (certReq->extensions == NULL)) {
CssmError::throwMe(CSSMERR_TP_INVALID_POINTER);
}