Back to index

lightning-sunbird  0.9+nobinonly
Functions
cmmf.h File Reference
#include "seccomon.h"
#include "cmmft.h"
#include "crmf.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

SEC_BEGIN_PROTOS
CMMFCertRepContent * 
CMMF_CreateCertRepContent (void)
CMMFCertRepContent * CMMF_CreateCertRepContentFromDER (CERTCertDBHandle *db, const char *buf, long len)
CMMFCertResponse * CMMF_CreateCertResponse (long inCertReqId)
CMMFKeyRecRepContent * CMMF_CreateKeyRecRepContent (void)
CMMFKeyRecRepContent * CMMF_CreateKeyRecRepContentFromDER (CERTCertDBHandle *db, const char *buf, long len)
CMMFPOPODecKeyChallContent * CMMF_CreatePOPODecKeyChallContent (void)
CMMFPOPODecKeyChallContent * CMMF_CreatePOPODecKeyChallContentFromDER (const char *buf, long len)
CMMFPOPODecKeyRespContent * CMMF_CreatePOPODecKeyRespContentFromDER (const char *buf, long len)
SECStatus CMMF_CertRepContentSetCertResponses (CMMFCertRepContent *inCertRepContent, CMMFCertResponse **inCertResponses, int inNumResponses)
SECStatus CMMF_CertRepContentSetCAPubs (CMMFCertRepContent *inCertRepContent, CERTCertList *inCAPubs)
SECStatus CMMF_CertResponseSetPKIStatusInfoStatus (CMMFCertResponse *inCertResp, CMMFPKIStatus inPKIStatus)
SECStatus CMMF_CertResponseSetCertificate (CMMFCertResponse *inCertResp, CERTCertificate *inCertificate)
SECStatus CMMF_KeyRecRepContentSetPKIStatusInfoStatus (CMMFKeyRecRepContent *inKeyRecRep, CMMFPKIStatus inPKIStatus)
SECStatus CMMF_KeyRecRepContentSetNewSignCert (CMMFKeyRecRepContent *inKeyRecRep, CERTCertificate *inNewSignCert)
SECStatus CMMF_KeyRecRepContentSetCACerts (CMMFKeyRecRepContent *inKeyRecRep, CERTCertList *inCACerts)
SECStatus CMMF_KeyRecRepContentSetCertifiedKeyPair (CMMFKeyRecRepContent *inKeyRecRep, CERTCertificate *inCert, SECKEYPrivateKey *inPrivKey, SECKEYPublicKey *inPubKey)
SECStatus CMMF_POPODecKeyChallContentSetNextChallenge (CMMFPOPODecKeyChallContent *inDecKeyChall, long inRandom, CERTGeneralName *inSender, SECKEYPublicKey *inPubKey, void *passwdArg)
SECStatus CMMF_EncodeCertRepContent (CMMFCertRepContent *inCertRepContent, CRMFEncoderOutputCallback inCallback, void *inArg)
SECStatus CMMF_EncodeKeyRecRepContent (CMMFKeyRecRepContent *inKeyRecRep, CRMFEncoderOutputCallback inCallback, void *inArg)
SECStatus CMMF_EncodePOPODecKeyChallContent (CMMFPOPODecKeyChallContent *inDecKeyChall, CRMFEncoderOutputCallback inCallback, void *inArg)
SECStatus CMMF_EncodePOPODecKeyRespContent (long *inDecodedRand, int inNumRand, CRMFEncoderOutputCallback inCallback, void *inArg)
CERTCertList * CMMF_CertRepContentGetCAPubs (CMMFCertRepContent *inCertRepContent)
int CMMF_CertRepContentGetNumResponses (CMMFCertRepContent *inCertRepContent)
CMMFCertResponse * CMMF_CertRepContentGetResponseAtIndex (CMMFCertRepContent *inCertRepContent, int inIndex)
long CMMF_CertResponseGetCertReqId (CMMFCertResponse *inCertResp)
CMMFPKIStatus CMMF_CertResponseGetPKIStatusInfoStatus (CMMFCertResponse *inCertResp)
CERTCertificate * CMMF_CertResponseGetCertificate (CMMFCertResponse *inCertResp, CERTCertDBHandle *inCertdb)
CMMFPKIStatus CMMF_KeyRecRepContentGetPKIStatusInfoStatus (CMMFKeyRecRepContent *inKeyRecRep)
CERTCertificate * CMMF_KeyRecRepContentGetNewSignCert (CMMFKeyRecRepContent *inKeyRecRep)
CERTCertList * CMMF_KeyRecRepContentGetCACerts (CMMFKeyRecRepContent *inKeyRecRep)
int CMMF_KeyRecRepContentGetNumKeyPairs (CMMFKeyRecRepContent *inKeyRecRep)
CMMFCertifiedKeyPair * CMMF_KeyRecRepContentGetCertKeyAtIndex (CMMFKeyRecRepContent *inKeyRecRep, int inIndex)
CERTCertificate * CMMF_CertifiedKeyPairGetCertificate (CMMFCertifiedKeyPair *inCertKeyPair, CERTCertDBHandle *inCertdb)
int CMMF_POPODecKeyChallContentGetNumChallenges (CMMFPOPODecKeyChallContent *inKeyChallCont)
SECItem * CMMF_POPODecKeyChallContentGetPublicValue (CMMFPOPODecKeyChallContent *inKeyChallCont, int inIndex)
SECStatus CMMF_POPODecKeyChallContentGetRandomNumber (CMMFPOPODecKeyChallContent *inKeyChallCont, int inIndex, long *inDest)
int CMMF_POPODecKeyRespContentGetNumResponses (CMMFPOPODecKeyRespContent *inRespCont)
SECStatus CMMF_POPODecKeyRespContentGetResponse (CMMFPOPODecKeyRespContent *inRespCont, int inIndex, long *inDest)
SECStatus CMMF_DestroyCertResponse (CMMFCertResponse *inCertResp)
SECStatus CMMF_DestroyCertRepContent (CMMFCertRepContent *inCertRepContent)
SECStatus CMMF_DestroyKeyRecRepContent (CMMFKeyRecRepContent *inKeyRecRep)
SECStatus CMMF_DestroyCertifiedKeyPair (CMMFCertifiedKeyPair *inCertKeyPair)
SECStatus CMMF_DestroyPOPODecKeyRespContent (CMMFPOPODecKeyRespContent *inDecKeyResp)
SECStatus CMMF_CertifiedKeyPairUnwrapPrivKey (CMMFCertifiedKeyPair *inKeyPair, SECKEYPrivateKey *inPrivKey, SECItem *inNickName, PK11SlotInfo *inSlot, CERTCertDBHandle *inCertdb, SECKEYPrivateKey **destPrivKey, void *wincx)
PRBool CMMF_KeyRecRepContentHasCACerts (CMMFKeyRecRepContent *inKeyRecRep)
SECStatus CMMF_POPODecKeyChallContDecryptChallenge (CMMFPOPODecKeyChallContent *inChalCont, int inIndex, SECKEYPrivateKey *inPrivKey)
SECStatus CMMF_DestroyPOPODecKeyChallContent (CMMFPOPODecKeyChallContent *inDecKeyCont)

Function Documentation

CERTCertificate* CMMF_CertifiedKeyPairGetCertificate ( CMMFCertifiedKeyPair *  inCertKeyPair,
CERTCertDBHandle *  inCertdb 
)

Definition at line 306 of file cmmfresp.c.

{
    PORT_Assert(inCertKeyPair != NULL);
    if (inCertKeyPair == NULL) {
        return NULL;
    }
    return cmmf_CertOrEncCertGetCertificate(&inCertKeyPair->certOrEncCert,
                                       inCertdb);
}

Here is the call graph for this function:

SECStatus CMMF_CertifiedKeyPairUnwrapPrivKey ( CMMFCertifiedKeyPair *  inKeyPair,
SECKEYPrivateKey *  inPrivKey,
SECItem *  inNickName,
PK11SlotInfo *  inSlot,
CERTCertDBHandle *  inCertdb,
SECKEYPrivateKey **  destPrivKey,
void wincx 
)

Definition at line 302 of file cmmfrec.c.

{
    CERTCertificate *cert;
    SECItem keyUsageValue = {siBuffer, NULL, 0};
    unsigned char keyUsage = 0x0;
    SECKEYPublicKey *pubKey;
    SECStatus rv;

    PORT_Assert(inKeyPair != NULL &&
              inPrivKey != NULL && inCertdb != NULL);
    if (inKeyPair             == NULL ||
       inPrivKey             == NULL ||
       inKeyPair->privateKey == NULL ||
       inCertdb              == NULL) {
        return SECFailure;
    }
    
    cert = CMMF_CertifiedKeyPairGetCertificate(inKeyPair, inCertdb);
    CERT_FindKeyUsageExtension(cert, &keyUsageValue);
    if (keyUsageValue.data != NULL) {
        keyUsage = keyUsageValue.data[3];
       PORT_Free(keyUsageValue.data);
    }
    pubKey = CERT_ExtractPublicKey(cert);
    rv = crmf_encrypted_value_unwrap_priv_key(NULL, inKeyPair->privateKey,
                                         inPrivKey, pubKey, 
                                         inNickName, inSlot, keyUsage, 
                                         destPrivKey, wincx);
    SECKEY_DestroyPublicKey(pubKey);
    CERT_DestroyCertificate(cert);
    return rv;
}

Here is the call graph for this function:

CERTCertList* CMMF_CertRepContentGetCAPubs ( CMMFCertRepContent *  inCertRepContent)

Definition at line 161 of file respcli.c.

{
    PORT_Assert (inCertRepContent != NULL);
    if (inCertRepContent == NULL || inCertRepContent->caPubs == NULL) {
        return NULL;
    }
    return cmmf_MakeCertList(inCertRepContent->caPubs);
}

Here is the call graph for this function:

int CMMF_CertRepContentGetNumResponses ( CMMFCertRepContent *  inCertRepContent)

Definition at line 214 of file respcmn.c.

{
    int numResponses = 0;
    PORT_Assert (inCertRepContent != NULL);
    if (inCertRepContent != NULL && inCertRepContent->response != NULL) {
        while (inCertRepContent->response[numResponses] != NULL) {
           numResponses++;
       }
    }
    return numResponses;
}
CMMFCertResponse* CMMF_CertRepContentGetResponseAtIndex ( CMMFCertRepContent *  inCertRepContent,
int  inIndex 
)

Definition at line 114 of file respcli.c.

{
    CMMFCertResponse *certResponse;
    SECStatus         rv;

    PORT_Assert(inCertRepContent != NULL &&
              cmmf_CertRepContentIsIndexValid(inCertRepContent, inIndex));
    if (inCertRepContent == NULL ||
       !cmmf_CertRepContentIsIndexValid(inCertRepContent, inIndex)) {
        return NULL;
    }
    certResponse = PORT_ZNew(CMMFCertResponse);
    rv = cmmf_CopyCertResponse(NULL, certResponse, 
                            inCertRepContent->response[inIndex]);
    if (rv != SECSuccess) {
        CMMF_DestroyCertResponse(certResponse);
       certResponse = NULL;
    }
    return certResponse;
}

Here is the call graph for this function:

SECStatus CMMF_CertRepContentSetCAPubs ( CMMFCertRepContent *  inCertRepContent,
CERTCertList *  inCAPubs 
)

Definition at line 275 of file cmmfresp.c.

{
    PRArenaPool      *poolp;
    void             *mark;
    SECStatus         rv;

    PORT_Assert(inCertRepContent != NULL &&
              inCAPubs         != NULL &&
              inCertRepContent->caPubs == NULL);
    
    if (inCertRepContent == NULL ||
       inCAPubs == NULL || inCertRepContent == NULL) {
        return SECFailure;
    }

    poolp = inCertRepContent->poolp;
    mark = PORT_ArenaMark(poolp);

    rv = cmmf_ExtractCertsFromList(inCAPubs, poolp,
                               &inCertRepContent->caPubs);

    if (rv != SECSuccess) {
        PORT_ArenaRelease(poolp, mark);
    } else {
        PORT_ArenaUnmark(poolp, mark);
    }
    return rv;
}

Here is the call graph for this function:

SECStatus CMMF_CertRepContentSetCertResponses ( CMMFCertRepContent *  inCertRepContent,
CMMFCertResponse **  inCertResponses,
int  inNumResponses 
)

Definition at line 155 of file cmmfresp.c.

{
    PRArenaPool       *poolp;
    CMMFCertResponse **respArr, *newResp;
    void              *mark;
    SECStatus          rv;
    int                i;

    PORT_Assert (inCertRepContent != NULL &&
               inCertResponses  != NULL &&
               inNumResponses    > 0);
    if (inCertRepContent == NULL ||
       inCertResponses  == NULL ||
       inCertRepContent->response != NULL) {
        return SECFailure;
    }
    poolp = inCertRepContent->poolp;
    mark = PORT_ArenaMark(poolp);
    respArr = inCertRepContent->response = 
        PORT_ArenaZNewArray(poolp, CMMFCertResponse*, (inNumResponses+1));
    if (respArr == NULL) {
        goto loser;
    }
    for (i=0; i<inNumResponses; i++) {
        newResp = PORT_ArenaZNew(poolp, CMMFCertResponse);
       if (newResp == NULL) {
           goto loser;
       }
        rv = cmmf_CopyCertResponse(poolp, newResp, inCertResponses[i]);
       if (rv != SECSuccess) {
           goto loser;
       }
       respArr[i] = newResp;
    }
    respArr[inNumResponses] = NULL;
    PORT_ArenaUnmark(poolp, mark);
    return SECSuccess;

 loser:
    PORT_ArenaRelease(poolp, mark);
    return SECFailure;
}

Here is the call graph for this function:

CERTCertificate* CMMF_CertResponseGetCertificate ( CMMFCertResponse *  inCertResp,
CERTCertDBHandle *  inCertdb 
)

Definition at line 147 of file respcli.c.

{
    PORT_Assert(inCertResp != NULL);
    if (inCertResp == NULL || inCertResp->certifiedKeyPair == NULL) {
        return NULL;
    }
    
    return cmmf_CertOrEncCertGetCertificate(
              &inCertResp->certifiedKeyPair->certOrEncCert, inCertdb);
                               
}

Here is the call graph for this function:

long CMMF_CertResponseGetCertReqId ( CMMFCertResponse *  inCertResp)

Definition at line 93 of file respcli.c.

{
    PORT_Assert(inCertResp != NULL);
    if (inCertResp == NULL) {
        return -1;
    }
    return DER_GetInteger(&inCertResp->certReqId);
}

Here is the call graph for this function:

CMMFPKIStatus CMMF_CertResponseGetPKIStatusInfoStatus ( CMMFCertResponse *  inCertResp)

Definition at line 137 of file respcli.c.

{
    PORT_Assert(inCertResp != NULL);
    if (inCertResp == NULL) {
        return cmmfNoPKIStatus;
    }
    return cmmf_PKIStatusInfoGetStatus(&inCertResp->status);
}

Here is the call graph for this function:

SECStatus CMMF_CertResponseSetCertificate ( CMMFCertResponse *  inCertResp,
CERTCertificate *  inCertificate 
)

Definition at line 238 of file cmmfresp.c.

{
    CMMFCertifiedKeyPair *keyPair = NULL;
    SECStatus             rv = SECFailure;

    PORT_Assert(inCertResp != NULL && inCertificate != NULL);
    if (inCertResp == NULL || inCertificate == NULL) {
        return SECFailure;
    }
    if (inCertResp->certifiedKeyPair == NULL) {
        keyPair = inCertResp->certifiedKeyPair = 
           PORT_ZNew(CMMFCertifiedKeyPair);
    } else {
        keyPair = inCertResp->certifiedKeyPair;
    }
    if (keyPair == NULL) {
        goto loser;
    }
    rv = cmmf_CertOrEncCertSetCertificate(&keyPair->certOrEncCert, NULL,
                                     inCertificate);
    if (rv != SECSuccess) {
        goto loser;
    }
    return SECSuccess;
 loser:
    if (keyPair) {
        if (keyPair->certOrEncCert.derValue.data) {
           PORT_Free(keyPair->certOrEncCert.derValue.data);
       }
       PORT_Free(keyPair);
    }
    return rv;
}

Here is the call graph for this function:

SECStatus CMMF_CertResponseSetPKIStatusInfoStatus ( CMMFCertResponse *  inCertResp,
CMMFPKIStatus  inPKIStatus 
)

Definition at line 224 of file cmmfresp.c.

{
    PORT_Assert (inCertResp != NULL && inPKIStatus >= cmmfGranted
               && inPKIStatus < cmmfNumPKIStatus);

    if  (inCertResp == NULL) {
        return SECFailure;
    }
    return cmmf_PKIStatusInfoSetStatus(&inCertResp->status, NULL,
                                   inPKIStatus);
}

Here is the call graph for this function:

SEC_BEGIN_PROTOS CMMFCertRepContent* CMMF_CreateCertRepContent ( void  )

Definition at line 51 of file cmmfresp.c.

{
    CMMFCertRepContent *retCertRep;
    PRArenaPool        *poolp;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        goto loser;
    }
    retCertRep = PORT_ArenaZNew(poolp, CMMFCertRepContent);
    if (retCertRep == NULL) {
        goto loser;
    }
    retCertRep->poolp = poolp;
    return retCertRep;
 loser:
    if (poolp != NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
    }
    return NULL;
}

Here is the call graph for this function:

CMMFCertRepContent* CMMF_CreateCertRepContentFromDER ( CERTCertDBHandle *  db,
const char *  buf,
long  len 
)

Definition at line 54 of file respcli.c.

{
    PRArenaPool        *poolp;
    CMMFCertRepContent *certRepContent;
    SECStatus           rv;
    int                 i;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    certRepContent = PORT_ArenaZNew(poolp, CMMFCertRepContent);
    if (certRepContent == NULL) {
        goto loser;
    }
    certRepContent->poolp = poolp;
    rv = SEC_ASN1Decode(poolp, certRepContent, CMMFCertRepContentTemplate,
                     buf, len);
    if (rv != SECSuccess) {
        goto loser;
    }
    if (certRepContent->response != NULL) {
        for (i=0; certRepContent->response[i] != NULL; i++) {
           rv = cmmf_decode_process_cert_response(poolp, db,
                                          certRepContent->response[i]);
           if (rv != SECSuccess) {
               goto loser;
           }
       }
    }
    certRepContent->isDecoded = PR_TRUE;
    return certRepContent;
 loser:
    PORT_FreeArena(poolp, PR_FALSE);
    return NULL;
}

Here is the call graph for this function:

CMMFCertResponse* CMMF_CreateCertResponse ( long  inCertReqId)

Definition at line 201 of file cmmfresp.c.

{
    SECItem          *dummy;
    CMMFCertResponse *newResp;
    
    newResp = PORT_ZNew(CMMFCertResponse);
    if (newResp == NULL) {
        goto loser;
    }
    dummy = SEC_ASN1EncodeInteger(NULL, &newResp->certReqId, inCertReqId);
    if (dummy != &newResp->certReqId) {
        goto loser;
    }
    return newResp;

 loser:
    if (newResp != NULL) {
        CMMF_DestroyCertResponse(newResp);
    }
    return NULL;
}

Here is the call graph for this function:

CMMFKeyRecRepContent* CMMF_CreateKeyRecRepContent ( void  )

Definition at line 50 of file cmmfrec.c.

{
    PRArenaPool          *poolp;
    CMMFKeyRecRepContent *keyRecContent;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    keyRecContent = PORT_ArenaZNew(poolp, CMMFKeyRecRepContent);
    if (keyRecContent == NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
       return NULL;
    }
    keyRecContent->poolp = poolp;
    return keyRecContent;
}

Here is the call graph for this function:

CMMFKeyRecRepContent* CMMF_CreateKeyRecRepContentFromDER ( CERTCertDBHandle *  db,
const char *  buf,
long  len 
)

Definition at line 124 of file cmmfasn1.c.

{
    PRArenaPool          *poolp;
    CMMFKeyRecRepContent *keyRecContent;
    SECStatus             rv;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    keyRecContent = PORT_ArenaZNew(poolp, CMMFKeyRecRepContent);
    if (keyRecContent == NULL) {
        goto loser;
    }
    keyRecContent->poolp = poolp;
    rv = SEC_ASN1Decode(poolp, keyRecContent, CMMFKeyRecRepContentTemplate,
                     buf, len);
    if (rv != SECSuccess) {
        goto loser;
    }
    if (keyRecContent->keyPairHist != NULL) {
        while(keyRecContent->keyPairHist[keyRecContent->numKeyPairs] != NULL) {
           rv = cmmf_decode_process_certified_key_pair(poolp, db,
                     keyRecContent->keyPairHist[keyRecContent->numKeyPairs]);
           if (rv != SECSuccess) {
               goto loser;
           }
           keyRecContent->numKeyPairs++;
       }
       keyRecContent->allocKeyPairs = keyRecContent->numKeyPairs;
    }
    keyRecContent->isDecoded = PR_TRUE;
    return keyRecContent;
 loser:
    if (poolp != NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
    }
    return NULL;
}

Here is the call graph for this function:

CMMFPOPODecKeyChallContent* CMMF_CreatePOPODecKeyChallContent ( void  )

Definition at line 189 of file cmmfchal.c.

{
    PRArenaPool *poolp;
    CMMFPOPODecKeyChallContent *challContent;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    challContent = PORT_ArenaZNew(poolp, CMMFPOPODecKeyChallContent);
    if (challContent == NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
       return NULL;
    }
    challContent->poolp = poolp;
    return challContent;
}

Here is the call graph for this function:

CMMFPOPODecKeyChallContent* CMMF_CreatePOPODecKeyChallContentFromDER ( const char *  buf,
long  len 
)

Definition at line 46 of file challcli.c.

{
    PRArenaPool                *poolp;
    CMMFPOPODecKeyChallContent *challContent;
    SECStatus                   rv;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    challContent = PORT_ArenaZNew(poolp, CMMFPOPODecKeyChallContent);
    if (challContent == NULL) {
        goto loser;
    }
    challContent->poolp = poolp;
    rv = SEC_ASN1Decode(poolp, challContent, 
                     CMMFPOPODecKeyChallContentTemplate, buf, len);
    if (rv != SECSuccess) {
        goto loser;
    }
    if (challContent->challenges) {
      while (challContent->challenges[challContent->numChallenges] != NULL) {
         challContent->numChallenges++;
      }
      challContent->numAllocated = challContent->numChallenges;
    }
    return challContent;
 loser:
    if (poolp != NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
    }
    return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CMMFPOPODecKeyRespContent* CMMF_CreatePOPODecKeyRespContentFromDER ( const char *  buf,
long  len 
)

Definition at line 85 of file cmmfasn1.c.

{
    PRArenaPool               *poolp;
    CMMFPOPODecKeyRespContent *decKeyResp;
    SECStatus                  rv;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return NULL;
    }
    decKeyResp = PORT_ArenaZNew(poolp, CMMFPOPODecKeyRespContent);
    if (decKeyResp == NULL) {
        goto loser;
    }
    decKeyResp->poolp = poolp;
    rv = SEC_ASN1Decode(poolp, decKeyResp, CMMFPOPODecKeyRespContentTemplate,
                     buf, len);
    if (rv != SECSuccess) {
        goto loser;
    }
    return decKeyResp;
    
 loser:
    if (poolp != NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
    }
    return NULL;
}

Here is the call graph for this function:

SECStatus CMMF_DestroyCertifiedKeyPair ( CMMFCertifiedKeyPair *  inCertKeyPair)

Definition at line 265 of file respcmn.c.

{
    PORT_Assert(inCertKeyPair != NULL);
    if (inCertKeyPair != NULL) {
        cmmf_DestroyCertOrEncCert(&inCertKeyPair->certOrEncCert, PR_FALSE);
        if (inCertKeyPair->privateKey) {
            crmf_destroy_encrypted_value(inCertKeyPair->privateKey, PR_TRUE);
        }
        if (inCertKeyPair->derPublicationInfo.data) {
            PORT_Free(inCertKeyPair->derPublicationInfo.data);
        }
        PORT_Free(inCertKeyPair);
    }
    return SECSuccess;
}

Here is the call graph for this function:

SECStatus CMMF_DestroyCertRepContent ( CMMFCertRepContent *  inCertRepContent)

Definition at line 83 of file respcmn.c.

{
    PORT_Assert(inCertRepContent != NULL);
    if (inCertRepContent != NULL) {
        CMMFCertResponse   **pResponse = inCertRepContent->response;
        if (pResponse != NULL) {
            for (; *pResponse != NULL; pResponse++) {
               CMMFCertifiedKeyPair *certKeyPair = (*pResponse)->certifiedKeyPair;
              /* XXX Why not call CMMF_DestroyCertifiedKeyPair or
              ** XXX cmmf_DestroyCertOrEncCert ?  
              */
                if (certKeyPair != NULL                    &&
                    certKeyPair->certOrEncCert.choice == cmmfCertificate &&
                    certKeyPair->certOrEncCert.cert.certificate != NULL) {
                    CERT_DestroyCertificate
                                 (certKeyPair->certOrEncCert.cert.certificate);
                  certKeyPair->certOrEncCert.cert.certificate = NULL;
                }
            }
        }
       if (inCertRepContent->caPubs) {
           CERTCertificate     **caPubs = inCertRepContent->caPubs;
           for (; *caPubs; ++caPubs) {
              CERT_DestroyCertificate(*caPubs);
              *caPubs = NULL;
           }
       }
       if (inCertRepContent->poolp != NULL) {
           PORT_FreeArena(inCertRepContent->poolp, PR_TRUE);
       }
    }
    return SECSuccess;
}

Here is the call graph for this function:

SECStatus CMMF_DestroyCertResponse ( CMMFCertResponse *  inCertResp)

Definition at line 66 of file respcmn.c.

{
    PORT_Assert(inCertResp != NULL);
    if (inCertResp != NULL) {
        if (inCertResp->certReqId.data != NULL) {
           PORT_Free(inCertResp->certReqId.data);
       }
       cmmf_DestroyPKIStatusInfo(&inCertResp->status, PR_FALSE);
       if (inCertResp->certifiedKeyPair != NULL) {
           CMMF_DestroyCertifiedKeyPair(inCertResp->certifiedKeyPair);
       }
       PORT_Free(inCertResp);
    }
    return SECSuccess;
}

Here is the call graph for this function:

SECStatus CMMF_DestroyKeyRecRepContent ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 69 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    if (inKeyRecRep != NULL && inKeyRecRep->poolp != NULL) {
       int i;

       if (!inKeyRecRep->isDecoded && inKeyRecRep->newSigCert != NULL) {
           CERT_DestroyCertificate(inKeyRecRep->newSigCert);
       }
       if (inKeyRecRep->caCerts != NULL) {
           for (i=0; inKeyRecRep->caCerts[i] != NULL; i++) {
              CERT_DestroyCertificate(inKeyRecRep->caCerts[i]);
           }
       }
       if (inKeyRecRep->keyPairHist != NULL) {
           for (i=0; inKeyRecRep->keyPairHist[i] != NULL; i++) {
               if (inKeyRecRep->keyPairHist[i]->certOrEncCert.choice ==
                     cmmfCertificate) {
                  CERT_DestroyCertificate(inKeyRecRep->keyPairHist[i]->
                                          certOrEncCert.cert.certificate);
              }
           }
       }
        PORT_FreeArena(inKeyRecRep->poolp, PR_TRUE);
    }
    return SECSuccess;
}

Here is the call graph for this function:

SECStatus CMMF_DestroyPOPODecKeyChallContent ( CMMFPOPODecKeyChallContent *  inDecKeyCont)

Definition at line 118 of file respcmn.c.

{
    PORT_Assert(inDecKeyCont != NULL);
    if (inDecKeyCont != NULL && inDecKeyCont->poolp) {
        PORT_FreeArena(inDecKeyCont->poolp, PR_FALSE);
    }
    return SECSuccess;
}
SECStatus CMMF_DestroyPOPODecKeyRespContent ( CMMFPOPODecKeyRespContent *  inDecKeyResp)

Definition at line 284 of file cmmfchal.c.

{
    PORT_Assert(inDecKeyResp != NULL);
    if (inDecKeyResp != NULL && inDecKeyResp->poolp != NULL) {
        PORT_FreeArena(inDecKeyResp->poolp, PR_FALSE);
    }
    return SECSuccess;
}
SECStatus CMMF_EncodeCertRepContent ( CMMFCertRepContent *  inCertRepContent,
CRMFEncoderOutputCallback  inCallback,
void inArg 
)

Definition at line 67 of file cmmfasn1.c.

{
    return cmmf_user_encode(inCertRepContent, inCallback, inArg,
                         CMMFCertRepContentTemplate);
}

Here is the call graph for this function:

SECStatus CMMF_EncodeKeyRecRepContent ( CMMFKeyRecRepContent *  inKeyRecRep,
CRMFEncoderOutputCallback  inCallback,
void inArg 
)

Definition at line 115 of file cmmfasn1.c.

{
    return cmmf_user_encode(inKeyRecRep, inCallback, inArg,
                         CMMFKeyRecRepContentTemplate);
}

Here is the call graph for this function:

SECStatus CMMF_EncodePOPODecKeyChallContent ( CMMFPOPODecKeyChallContent *  inDecKeyChall,
CRMFEncoderOutputCallback  inCallback,
void inArg 
)

Definition at line 76 of file cmmfasn1.c.

{
    return cmmf_user_encode(inDecKeyChall, inCallback, inArg,
                         CMMFPOPODecKeyChallContentTemplate);
}

Here is the call graph for this function:

SECStatus CMMF_EncodePOPODecKeyRespContent ( long inDecodedRand,
int  inNumRand,
CRMFEncoderOutputCallback  inCallback,
void inArg 
)

Definition at line 234 of file challcli.c.

{
    PRArenaPool *poolp;
    CMMFPOPODecKeyRespContent *response;
    SECItem *currItem;
    SECStatus rv=SECFailure;
    int i;

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        return SECFailure;
    }
    response = PORT_ArenaZNew(poolp, CMMFPOPODecKeyRespContent);
    if (response == NULL) {
        goto loser;
    }
    response->responses = PORT_ArenaZNewArray(poolp, SECItem*, inNumRand+1);
    if (response->responses == NULL) {
        goto loser;
    }
    for (i=0; i<inNumRand; i++) {
        currItem = response->responses[i] = PORT_ArenaZNew(poolp,SECItem);
       if (currItem == NULL) {
           goto loser;
       }
       currItem = SEC_ASN1EncodeInteger(poolp, currItem, inDecodedRand[i]);
       if (currItem == NULL) {
           goto loser;
       }
    }
    rv = cmmf_user_encode(response, inCallback, inArg,
                       CMMFPOPODecKeyRespContentTemplate);
 loser:
    if (poolp != NULL) {
        PORT_FreeArena(poolp, PR_FALSE);
    }
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CERTCertList* CMMF_KeyRecRepContentGetCACerts ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 250 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    if (inKeyRecRep == NULL || inKeyRecRep->caCerts == NULL) {
        return NULL;
    }
    return cmmf_MakeCertList(inKeyRecRep->caCerts);
}

Here is the call graph for this function:

CMMFCertifiedKeyPair* CMMF_KeyRecRepContentGetCertKeyAtIndex ( CMMFKeyRecRepContent *  inKeyRecRep,
int  inIndex 
)

Definition at line 276 of file cmmfrec.c.

{
    CMMFCertifiedKeyPair *newKeyPair;
    SECStatus             rv;

    PORT_Assert(inKeyRecRep != NULL &&
              cmmf_KeyRecRepContentIsValidIndex(inKeyRecRep, inIndex));
    if (inKeyRecRep == NULL ||
       !cmmf_KeyRecRepContentIsValidIndex(inKeyRecRep, inIndex)) {
        return NULL;
    }
    newKeyPair = PORT_ZNew(CMMFCertifiedKeyPair);
    if (newKeyPair == NULL) {
        return NULL;
    }
    rv = cmmf_CopyCertifiedKeyPair(NULL, newKeyPair, 
                               inKeyRecRep->keyPairHist[inIndex]);
    if (rv != SECSuccess) {
        CMMF_DestroyCertifiedKeyPair(newKeyPair);
       newKeyPair = NULL;
    }
    return newKeyPair;
}

Here is the call graph for this function:

CERTCertificate* CMMF_KeyRecRepContentGetNewSignCert ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 231 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    if (inKeyRecRep             == NULL ||
       inKeyRecRep->newSigCert == NULL) {
        return NULL;
    }
    /* newSigCert may not be a real certificate, it may be a hand decoded
     * cert structure. This code makes sure we hand off a real, fully formed
     * CERTCertificate to the caller. TODO: This should move into the decode
     * portion so that we never wind up with a half formed CERTCertificate
     * here. In this case the call would be to CERT_DupCertificate.
     */
    return CERT_NewTempCertificate(CERT_GetDefaultCertDB(), 
                               &inKeyRecRep->newSigCert->signatureWrap.data,
                               NULL, PR_FALSE, PR_TRUE);
}

Here is the call graph for this function:

int CMMF_KeyRecRepContentGetNumKeyPairs ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 260 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    return (inKeyRecRep == NULL) ? 0 : inKeyRecRep->numKeyPairs;
}
CMMFPKIStatus CMMF_KeyRecRepContentGetPKIStatusInfoStatus ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 221 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    if (inKeyRecRep == NULL) {
        return cmmfNoPKIStatus;
    }
    return cmmf_PKIStatusInfoGetStatus(&inKeyRecRep->status);
}

Here is the call graph for this function:

PRBool CMMF_KeyRecRepContentHasCACerts ( CMMFKeyRecRepContent *  inKeyRecRep)

Definition at line 343 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL);
    if (inKeyRecRep == NULL) {
        return PR_FALSE;
    }
    return (PRBool)(inKeyRecRep->caCerts    != NULL && 
                  inKeyRecRep->caCerts[0] != NULL);
}
SECStatus CMMF_KeyRecRepContentSetCACerts ( CMMFKeyRecRepContent *  inKeyRecRep,
CERTCertList *  inCACerts 
)

Definition at line 129 of file cmmfrec.c.

{
    SECStatus rv;
    void *mark;

    PORT_Assert (inKeyRecRep != NULL && inCACerts != NULL);
    if (inKeyRecRep == NULL || inCACerts == NULL) {
        return SECFailure;
    }
    mark = PORT_ArenaMark(inKeyRecRep->poolp);
    rv = cmmf_ExtractCertsFromList(inCACerts, inKeyRecRep->poolp,
                               &inKeyRecRep->caCerts);
    if (rv != SECSuccess) {
        PORT_ArenaRelease(inKeyRecRep->poolp, mark);
    } else {
        PORT_ArenaUnmark(inKeyRecRep->poolp, mark);
    }
    return rv;
}

Here is the call graph for this function:

SECStatus CMMF_KeyRecRepContentSetCertifiedKeyPair ( CMMFKeyRecRepContent *  inKeyRecRep,
CERTCertificate *  inCert,
SECKEYPrivateKey *  inPrivKey,
SECKEYPublicKey *  inPubKey 
)

Definition at line 151 of file cmmfrec.c.

{
    CMMFCertifiedKeyPair *keyPair;
    CRMFEncryptedValue   *dummy;
    PRArenaPool          *poolp;
    void                 *mark;
    SECStatus             rv;

    PORT_Assert (inKeyRecRep != NULL &&
               inCert      != NULL &&
               inPrivKey   != NULL &&
               inPubKey    != NULL);
    if (inKeyRecRep == NULL ||
       inCert      == NULL ||
       inPrivKey   == NULL ||
       inPubKey    == NULL) {
        return SECFailure;
    }
    poolp = inKeyRecRep->poolp;
    mark = PORT_ArenaMark(poolp);
    if (inKeyRecRep->keyPairHist == NULL) {
        inKeyRecRep->keyPairHist = PORT_ArenaNewArray(poolp, 
                                                CMMFCertifiedKeyPair*,
                                                (CMMF_MAX_KEY_PAIRS+1));
       if (inKeyRecRep->keyPairHist == NULL) {
           goto loser;
       }
       inKeyRecRep->allocKeyPairs = CMMF_MAX_KEY_PAIRS;
       inKeyRecRep->numKeyPairs   = 0;
    }

    if (inKeyRecRep->allocKeyPairs == inKeyRecRep->numKeyPairs) {
        goto loser;
    }
    
    keyPair = PORT_ArenaZNew(poolp, CMMFCertifiedKeyPair);
    if (keyPair == NULL) {
        goto loser;
    }
    rv = cmmf_CertOrEncCertSetCertificate(&keyPair->certOrEncCert,
                                     poolp, inCert);
    if (rv != SECSuccess) {
        goto loser;
    }
    keyPair->privateKey = PORT_ArenaZNew(poolp, CRMFEncryptedValue);
    if (keyPair->privateKey == NULL) {
        goto loser;
    }
    dummy = crmf_create_encrypted_value_wrapped_privkey(inPrivKey, inPubKey, 
                                                 keyPair->privateKey);
    PORT_Assert(dummy == keyPair->privateKey);
    if (dummy != keyPair->privateKey) {
        crmf_destroy_encrypted_value(dummy, PR_TRUE);
       goto loser;
    }
    inKeyRecRep->keyPairHist[inKeyRecRep->numKeyPairs] = keyPair;
    inKeyRecRep->numKeyPairs++;
    inKeyRecRep->keyPairHist[inKeyRecRep->numKeyPairs] = NULL;
    PORT_ArenaUnmark(poolp, mark);
    return SECSuccess;

 loser:
    PORT_ArenaRelease(poolp, mark);
    return SECFailure;
}

Here is the call graph for this function:

SECStatus CMMF_KeyRecRepContentSetNewSignCert ( CMMFKeyRecRepContent *  inKeyRecRep,
CERTCertificate *  inNewSignCert 
)

Definition at line 113 of file cmmfrec.c.

{
    PORT_Assert (inKeyRecRep != NULL && inNewSignCert != NULL);
    if (inKeyRecRep == NULL || inNewSignCert == NULL) {
        return SECFailure;
    }
    if (!inKeyRecRep->isDecoded && inKeyRecRep->newSigCert) {
       CERT_DestroyCertificate(inKeyRecRep->newSigCert);
    }
    inKeyRecRep->isDecoded = PR_FALSE;
    inKeyRecRep->newSigCert = CERT_DupCertificate(inNewSignCert);
    return (inKeyRecRep->newSigCert == NULL) ? SECFailure : SECSuccess;    
}

Here is the call graph for this function:

SECStatus CMMF_KeyRecRepContentSetPKIStatusInfoStatus ( CMMFKeyRecRepContent *  inKeyRecRep,
CMMFPKIStatus  inPKIStatus 
)

Definition at line 98 of file cmmfrec.c.

{
    PORT_Assert(inKeyRecRep != NULL && inPKIStatus >= cmmfGranted &&
              inPKIStatus < cmmfNumPKIStatus);
    if (inKeyRecRep == NULL) {
        return SECFailure;
    }
    
    return cmmf_PKIStatusInfoSetStatus(&inKeyRecRep->status, 
                                   inKeyRecRep->poolp,
                                   inPKIStatus);
}

Here is the call graph for this function:

SECStatus CMMF_POPODecKeyChallContDecryptChallenge ( CMMFPOPODecKeyChallContent *  inChalCont,
int  inIndex,
SECKEYPrivateKey *  inPrivKey 
)

Definition at line 119 of file challcli.c.

{
    CMMFChallenge  *challenge;
    SECItem        *decryptedRand=NULL;
    PRArenaPool    *poolp  = NULL;
    SECAlgorithmID *owf;
    SECStatus       rv     = SECFailure;
    SECOidTag       tag;
    CMMFRand        randStr;
    SECItem         hashItem;
    unsigned char   hash[HASH_LENGTH_MAX]; 

    PORT_Assert(inChalCont != NULL && inPrivKey != NULL);
    if (inChalCont == NULL || inIndex <0 || inIndex > inChalCont->numChallenges
       || inPrivKey == NULL){
        return SECFailure;
    }

    poolp = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    if (poolp == NULL) {
        goto loser;
    }

    challenge = inChalCont->challenges[inIndex];
    decryptedRand = SECITEM_AllocItem(poolp, NULL, challenge->challenge.len);
    if (decryptedRand == NULL) {
        goto loser;
    }
    rv = PK11_PrivDecryptPKCS1(inPrivKey, decryptedRand->data, 
                     &decryptedRand->len, decryptedRand->len, 
                     challenge->challenge.data, challenge->challenge.len);
    if (rv != SECSuccess) {
        goto loser;
    }

    rv = SEC_ASN1DecodeItem(poolp, &randStr, CMMFRandTemplate,
                         decryptedRand); 
    if (rv != SECSuccess) {
        goto loser;
    }
    rv = SECFailure; /* Just so that when we do go to loser,
                    * I won't have to set it again.
                    */
    owf = cmmf_get_owf(inChalCont, inIndex);
    if (owf == NULL) {
        /* No hashing algorithm came with the challenges.  Can't verify */
        goto loser;
    }
    /* Verify the hashes in the challenge */
    tag = SECOID_FindOIDTag(&owf->algorithm);
    hashItem.len = HASH_ResultLenByOidTag(tag);
    if (!hashItem.len)
        goto loser;  /* error code has been set */

    rv = PK11_HashBuf(tag, hash, randStr.integer.data, randStr.integer.len);
    if (rv != SECSuccess) {
        goto loser;
    }
    hashItem.data = hash;
    if (SECITEM_CompareItem(&hashItem, &challenge->witness) != SECEqual) {
        /* The hash for the data we decrypted doesn't match the hash provided
        * in the challenge.  Bail out.
        */
       PORT_SetError(SEC_ERROR_BAD_DATA);
        rv = SECFailure;
       goto loser;
    }
    rv = PK11_HashBuf(tag, hash, challenge->senderDER.data, 
                    challenge->senderDER.len);
    if (rv != SECSuccess) {
        goto loser;
    }
    if (SECITEM_CompareItem(&hashItem, &randStr.senderHash) != SECEqual) {
        /* The hash for the data we decrypted doesn't match the hash provided
        * in the challenge.  Bail out.
        */
       PORT_SetError(SEC_ERROR_BAD_DATA);
        rv = SECFailure;
       goto loser;
    }
    /* All of the hashes have verified, so we can now store the integer away.*/
    rv = SECITEM_CopyItem(inChalCont->poolp, &challenge->randomNumber,
                       &randStr.integer);
 loser:
    if (poolp) {
       PORT_FreeArena(poolp, PR_FALSE);
    }
    return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CMMF_POPODecKeyChallContentGetNumChallenges ( CMMFPOPODecKeyChallContent *  inKeyChallCont)

Definition at line 82 of file challcli.c.

{
    PORT_Assert(inKeyChallCont != NULL);
    if (inKeyChallCont == NULL) {
        return 0;
    }
    return inKeyChallCont->numChallenges;
}
SECItem* CMMF_POPODecKeyChallContentGetPublicValue ( CMMFPOPODecKeyChallContent *  inKeyChallCont,
int  inIndex 
)

Definition at line 93 of file challcli.c.

{
    PORT_Assert(inKeyChallCont != NULL);
    if (inKeyChallCont == NULL || (inIndex > inKeyChallCont->numChallenges-1)||
       inIndex < 0) {
        return NULL;
    }
    return SECITEM_DupItem(&inKeyChallCont->challenges[inIndex]->key);
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus CMMF_POPODecKeyChallContentGetRandomNumber ( CMMFPOPODecKeyChallContent *  inKeyChallCont,
int  inIndex,
long inDest 
)

Definition at line 213 of file challcli.c.

{
    CMMFChallenge *challenge;
    
    PORT_Assert(inKeyChallCont != NULL);
    if (inKeyChallCont == NULL || inIndex > 0 || inIndex >= 
       inKeyChallCont->numChallenges) {
        return SECFailure;
    }
    challenge = inKeyChallCont->challenges[inIndex];
    if (challenge->randomNumber.data == NULL) {
        /* There is no random number here, nothing to see. */
        return SECFailure;
    }
    *inDest = DER_GetInteger(&challenge->randomNumber);
    return (*inDest == -1) ? SECFailure : SECSuccess;
}

Here is the call graph for this function:

Here is the caller graph for this function:

SECStatus CMMF_POPODecKeyChallContentSetNextChallenge ( CMMFPOPODecKeyChallContent *  inDecKeyChall,
long  inRandom,
CERTGeneralName *  inSender,
SECKEYPublicKey *  inPubKey,
void passwdArg 
)

Definition at line 209 of file cmmfchal.c.

{
    CMMFChallenge               *curChallenge;
    PRArenaPool                 *genNamePool = NULL, *poolp;
    SECStatus                    rv;
    SECItem                     *genNameDER;
    void                        *mark;

    PORT_Assert (inDecKeyChall != NULL &&
               inSender      != NULL &&
               inPubKey      != NULL);

    if (inDecKeyChall == NULL || 
       inSender      == NULL || inPubKey == NULL) {
        return SECFailure;
    }
    poolp = inDecKeyChall->poolp;
    mark = PORT_ArenaMark(poolp);

    genNamePool = PORT_NewArena(CRMF_DEFAULT_ARENA_SIZE);
    genNameDER = CERT_EncodeGeneralName(inSender, NULL, genNamePool);
    if (genNameDER == NULL) {
        rv = SECFailure;
        goto loser;
    }
    if (inDecKeyChall->challenges == NULL) {
        inDecKeyChall->challenges =
           PORT_ArenaZNewArray(poolp, CMMFChallenge*,(CMMF_MAX_CHALLENGES+1));
       inDecKeyChall->numAllocated = CMMF_MAX_CHALLENGES;
    }

    if (inDecKeyChall->numChallenges >= inDecKeyChall->numAllocated) {
        rv = SECFailure;
        goto loser;
    }

    if (inDecKeyChall->numChallenges == 0) {
        rv = cmmf_create_first_challenge(inDecKeyChall, inRandom, 
                                    genNameDER, inPubKey, passwdArg);
    } else {
        curChallenge = PORT_ArenaZNew(poolp, CMMFChallenge);
       if (curChallenge == NULL) {
           rv = SECFailure;
           goto loser;
       }
       rv = cmmf_create_witness_and_challenge(poolp, curChallenge, inRandom, 
                                          genNameDER, inPubKey, 
                                          passwdArg);
       if (rv == SECSuccess) {
           inDecKeyChall->challenges[inDecKeyChall->numChallenges] =
               curChallenge;
           inDecKeyChall->numChallenges++;
       }
    }
    if (rv != SECSuccess) {
        goto loser;
    }
    PORT_ArenaUnmark(poolp, mark);
    PORT_FreeArena(genNamePool, PR_FALSE);
    return SECSuccess;

 loser:
    PORT_ArenaRelease(poolp, mark);
    if (genNamePool != NULL) {
        PORT_FreeArena(genNamePool, PR_FALSE);
    }
    PORT_Assert(rv != SECSuccess);
    return rv;
}

Here is the call graph for this function:

int CMMF_POPODecKeyRespContentGetNumResponses ( CMMFPOPODecKeyRespContent *  inRespCont)

Definition at line 294 of file cmmfchal.c.

{
    int numResponses = 0;

    PORT_Assert(inRespCont != NULL);
    if (inRespCont == NULL) {
        return 0;
    }

    while (inRespCont->responses[numResponses] != NULL) {
        numResponses ++;
    }
    return numResponses;
}
SECStatus CMMF_POPODecKeyRespContentGetResponse ( CMMFPOPODecKeyRespContent *  inRespCont,
int  inIndex,
long inDest 
)

Definition at line 310 of file cmmfchal.c.

{
    PORT_Assert(inRespCont != NULL);
    
    if (inRespCont == NULL || inIndex < 0 || 
       inIndex >= CMMF_POPODecKeyRespContentGetNumResponses(inRespCont)) {
        return SECFailure;
    }
    *inDest = DER_GetInteger(inRespCont->responses[inIndex]);
    return (*inDest == -1) ? SECFailure : SECSuccess;
}

Here is the call graph for this function: