124 &msgData, CRYPT_IATTRIBUTE_SUBJECT );
129 &msgData, CRYPT_IATTRIBUTE_SPKI );
138 CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER );
169 iCertRequest, CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER );
173 setBoundData( boundDataPtr, 0, issuerID, issuerIDlength );
175 "SELECT certData FROM certificates WHERE issuerID = ?",
176 NULL, 0, NULL, boundDataPtr,
195 "SELECT certData FROM certLog WHERE certID = ?",
196 NULL, 0, NULL, boundDataPtr,
233 status = extractCertData( iPkiUser, CRYPT_ICERTFORMAT_DATA,
242 "Couldn't extract PKI user data to add to certificate "
252 certID, certIDlength, NULL, 0, NULL, 0,
253 certData, certDataLength,
262 "PKI user add operation failed: " ) );
283 assert(
isReadPtr( keyID, keyIDlength ) );
292 status = getItemData( dbmsInfo, &iPkiUser, &dummy,
306 "Couldn't get information on PKI user to be "
314 "DELETE FROM pkiUsers WHERE certID = ?",
318 NULL, 0, NULL, 0, certID, certIDlength,
326 "PKI user delete operation failed: " ) );
363 "Certificate request information "
364 "inconsistent/invalid" ) );
368 status = checkRevRequest( dbmsInfo, iCertRequest );
372 "Revocation request doesn't correspond to a currently "
373 "active certificate" ) );
381 status = extractCertData( iCertRequest,
383 CRYPT_ICERTFORMAT_DATA : \
390 iCertRequest, CRYPT_IATTRIBUTE_AUTHCERTID );
404 "Couldn't extract certificate request data to add to "
405 "certificate store" ) );
411 if( reqCertIDptr != NULL )
415 status = caGetIssuingUser( dbmsInfo, &iPkiUser, reqCertID,
416 reqCertIDlength, errorInfo );
422 "Certificate request submitted for "
423 "nonexistent PKI user", NULL, 0,
424 reqCertID, reqCertIDlength, NULL, 0,
428 "Certificate request submitted for nonexistent PKI "
473 if( isInitialOp && reqCertIDptr != NULL )
478 setBoundData( boundDataPtr, 0, reqCertID, reqCertIDlength );
480 "SELECT certID FROM certLog WHERE reqCertID = ? "
482 NULL, 0, NULL, boundDataPtr,
489 "Attempt to authorise additional certificate "
490 "issue when a certificate for this user has "
491 "already been issued", NULL, 0,
492 reqCertID, reqCertIDlength, NULL, 0, NULL, 0 );
495 "Attempt to authorise additional certificate issue "
496 "when a certificate for this user has already been "
518 int encodedCertDataLength;
521 &encodedCertDataLength, certData,
525 DEBUG_DIAG((
"Couldn't base64-encode data" ));
530 encodedCertDataLength );
533 "INSERT INTO certRequests VALUES ("
544 status = updateCertLog( dbmsInfo,
550 certID, certIDlength, reqCertIDptr, reqCertIDlength,
551 NULL, 0, certData, certDataLength,
560 "Certificate request add operation failed: " ) );