Example #1
0
inline SJsonArrayNodeImpl* SJsonNodeImpl::GetArrayNodeImpl(
        const char* operation)
{
    VerifyType(operation, CJsonNode::eArray);

    return static_cast<SJsonArrayNodeImpl*>(this);
}
Example #2
0
inline SJsonObjectNodeImpl* SJsonNodeImpl::GetObjectNodeImpl(
        const char* operation)
{
    VerifyType(operation, CJsonNode::eObject);

    return static_cast<SJsonObjectNodeImpl*>(this);
}
Example #3
0
//=============================================================================
ServerShakeMsg::ServerShakeMsg(const unsigned char *message,
                               const unsigned int messageLength)
{
    if(messageLength < MAX_MSG_LENGTH)
        memcpy(mBuffer, message, messageLength);

    if(!VerifyType(NMT_SERVERSHAKE))
        return;

    Unpack();
}
Example #4
0
//=============================================================================
ListResponseMsg::ListResponseMsg(const unsigned char *message,
				 const unsigned int messageLength)
{
  if(messageLength < MAX_MSG_LENGTH)
    memcpy(mBuffer, message, messageLength);

  if(!VerifyType(NMT_LISTRESP))
    return;

  Unpack();
}
Example #5
0
static void ChkProtoType( void )
{
    TYPEPTR     ret1;
    TYPEPTR     ret2;
    TYPEPTR     typ1;
    TYPEPTR     typ2;

    typ1 = CurFunc->sym_type;
    SKIP_TYPEDEFS( typ1 );
    ret1 = typ1->object;
    typ2 = PrevProtoType;
    SKIP_TYPEDEFS( typ2 );
    ret2 = typ2->object;
    typ1->object = NULL;
    typ2->object = NULL;
    VerifyType( CurFunc->sym_type, PrevProtoType, CurFunc );
    typ1->object = ret1;
    typ2->object = ret2;
}
Example #6
0
void CPKCS12Handler::ExtractSecurityObjectsL(const TDesC8& aData, 
                                             const TDesC16& aPwd) 
    {
    LOG_("-> CPKCS12Handler::ExtractSecurityObjectsL()");
    if (iPassword) 
        {
        delete iPassword;
        iPassword = NULL;
        }

    // Make sure the data is in PKCS#12 format
    if (!VerifyType(aData)) 
        {
        LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL() LEAVE (KErrNotSupported)");
        User::Leave(KErrArgument);
        }
        
    // If we have been provided with a valid password, then proceed
    // to decrypt / parse; otherwise, prompt for pwd.
    if (aPwd.Length() > 0)
        {
        iPassword = aPwd.AllocL();
        LOG_(" Password provided by OMADM...");
        }
    else 
        {
        LOG_(" No password provided, prompting the user for one");

        iPassword = QueryPasswordL();
        }

    // Keep asking for the password until user cancels or inputs the
    // correct password
    while (ETrue) 
        {
        if (iPassword)
            {
            LOG_1(" Non-NULL password '%S' in use, decrypting", iPassword);
            TRAPD(err, iPkcsHandler->ParseL(aData, *iPassword));
            if (err != KErrNone) 
                {
                LOG_(" Breaking news: Password proved a miserable failure! Program terminated abruptly!");
                DisplayWrongPasswordNote();
                delete iPassword;
                iPassword = NULL;
                iPassword = QueryPasswordL();
                }
            else 
                {
                // Correct password provided by the user, 
                // break free from the vicious cycle.
                delete iPassword;
                iPassword = NULL;
                break;
                }
            }
        else
            {
            // User got tired of guessing and resorted to cancel
            LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL() LEAVE (KErrCancel)");
            User::Leave(KErrBadPassphrase);
            }
        }

    // Fetch references to keys and certs
    ExtractKeysAndCerts();

    LOG_("<- CPKCS12Handler::ExtractSecurityObjectsL()");
    }