59 "SELECT reqCertID FROM certLog WHERE certID = ?",
67 memcpy( certID, certData, length );
103 "SELECT action FROM certLog WHERE certID = ?",
109 switch( certData[ 0 ] )
122 DEBUG_DIAG((
"Unknown certificate action type %d",
171 #ifdef USE_CERT_OBSOLETE
175 CRYPT_NS_CERTTYPE_SMIMECA | \
176 CRYPT_NS_CERTTYPE_OBJECTSIGNINGCA;
194 CRYPT_IATTRIBUTE_BLOCKEDATTRS );
263 "SELECT certData FROM certificates WHERE keyID = ?",
264 NULL, 0, NULL, boundDataPtr,
266 resetErrorInfo( dbmsInfo );
310 memcpy( specialCertID, certID, certIDlength );
311 memcpy( specialCertID,
315 setBoundData( boundDataPtr, 0, specialCertID, certIDlength );
317 "DELETE FROM certificates WHERE certID = ?",
326 status = updateCertLog( dbmsInfo,
328 NULL, 0, NULL, 0, certID, certIDlength,
341 updateCertErrorLog( dbmsInfo, status,
342 "Certificate creation - completion operation "
343 "failed", NULL, 0, NULL, 0,
344 certID, certIDlength, NULL, 0 );
347 "Certificate creation - completion operation "
380 iReplaceCertificate );
383 status = getItemData( dbmsInfo, &iOrigCertificate, &dummy,
394 return( completeCert( dbmsInfo, iReplaceCertificate,
402 "Couldn't get information for the certificate to be "
407 status = revokeCertDirect( dbmsInfo, iOrigCertificate,
410 status = completeCert( dbmsInfo, iReplaceCertificate,
439 assert( ( iCertificate == NULL ) || \
449 if( iCertificate != NULL )
453 status = getCertIssueType( dbmsInfo, iCertRequest, &issueType,
FALSE );
463 "Couldn't extract certificate request information "
464 "needed to issue certificate" ) );
483 "Couldn't create certificate from certificate request "
488 status = sanitiseCertAttributes( iLocalCertificate );
494 "Certificate request contains attributes that would "
495 "result in the creation of a CA rather than a normal "
496 "user certificate" ) );
509 "Couldn't sign certificate created from certificate "
520 CRYPT_IATTRIBUTE_ISSUERANDSERIALNUMBER );
522 status = extractCertData( iLocalCertificate,
530 "Couldn't extract new certificate data to add to "
531 "certificate store" ) );
539 status = checkDuplicateAdd( dbmsInfo, iLocalCertificate, issueType );
545 "Certificate already exists in certificate store" ) );
557 status = updateCertLog( dbmsInfo, action, certID, certIDlength,
558 reqCertID, reqCertIDlength, NULL, 0,
559 certData, certDataLength,
564 setBoundData( boundDataPtr, 0, reqCertID, reqCertIDlength );
566 "DELETE FROM certRequests WHERE certID = ?",
578 updateCertErrorLog( dbmsInfo, status,
580 "Certificate issue operation failed" : \
581 "Certificate creation operation failed",
582 NULL, 0, reqCertID, reqCertIDlength, NULL, 0,
588 "Certificate issue operation failed: " : \
589 "Certificate creation operation failed: " ) );
594 if( iCertificate != NULL )
595 *iCertificate = iLocalCertificate;
636 status = getCertIssueType( dbmsInfo, iCertificate, &issueType,
TRUE );
641 "Couldn't get original certificate issue type to "
642 "complete certificate issue operation: " ) );
644 status = completeCert( dbmsInfo, iCertificate, issueType, errorInfo );
652 return( completeCertRenewal( dbmsInfo, iCertificate,
666 memcpy( incompleteCertID, certID, certIDlength );
669 setBoundData( boundDataPtr, 0, incompleteCertID, certIDlength );
671 "DELETE FROM certificates WHERE certID = ?",
674 status = updateCertLog( dbmsInfo, action, NULL, 0, NULL, 0,
675 certID, certIDlength, NULL, 0,
687 updateCertErrorLog( dbmsInfo, status,
688 "Certificate creation - drop operation failed, "
689 "performing straight delete", NULL, 0, NULL, 0,
690 certID, certIDlength, NULL, 0 );
692 "DELETE FROM certificates WHERE certID = ?",
696 updateCertErrorLogMsg( dbmsInfo, status,
"Fallback straight "
700 "Certificate creation - drop operation failed: " ) );
710 return( revokeCertDirect( dbmsInfo, iCertificate,