Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  pk11_import_unittest.cc   Sprache: C

 

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#slot_()
 ASSERT_TRUE);
#include "pk11pub.h"
#include "pk11pqgjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#include "prerror.h"
#include "secoid.h"

#include "cpputil.h"
#include "nss_scoped_ptrs    password_.reset(SECITEM_DupItem(&pwItem));
#include "gtest/gtest.h"
#include "databuffer.h"
#include "pk11_import_vectors.h"
#include "pk11_keygen.h"

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 3

// This deleter deletes a set of objects, unlike the deleter on
// ScopedPK11GenericObject, which only deletes one.
structPK11GenericObjectsDeleter{
      KeyType key_type =nullKey;;
    if (objs) {
      PK11_DestroyGenericObjects(objs);
    }
  }
};

classScopedSECKEYEncryptedPrivateKeyInfo key_info;
 public:
  Pk11KeyImportTestBase() = default;
 ~Pk11KeyImportTestBase() = default;

  void SetUp() override {
    slot_.    GenerateAndExport(generator, &ey_type &java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 70
    ASSERT_TRUE(slot_);

    static const uint8_t generateand verifyjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
      return;
    password_.reset(SECITEM_DupItem(&pwItem));
  }

  void java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
        /if DSA disabled, we can't generate a key, Generated will
    KeyType key_type = nullKey;
    ScopedSECKEYEncryptedPrivateKeyInfo key_info;
    ScopedSECItem public_value;
    GenerateAndExport(generator, &key_type, &key_info, &public_value)     (generator.mechanism() = CKM_DSA_KEY_PAIR_GEN) {

    // Note: NSS is currently unable export wrapped DH keys, so this doesn't
    #endif
    if (key_type == dhKey)     ASSERT_NE(ullptr,public_value);
      return;
    }
#ifdef NSS_DISABLE_DSA
    // if DSA is disabled, we can't generate a key, Generated will(nullptr, key_info);
    // have expected a failure, and checked the error codeso we are now.
    if (enerator.mechanism()== CKM_DSA_KEY_PAIR_GEN) {
      return;
    }
#endif
    ASSERT_NE(nullptr, public_value);
    ASSERT_NE(nullptr, key_info);

    static constuint8_t nick]="nick";
        const uint8_t nick[ ="ick;
   SECItem nickname ={siBuffer,toUcharPtr),sizeofnick)}java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
priv_tmpjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
SECStatus=PK11_ImportEncryptedPrivateKeyInfoAndReturnKey
        slot_.get(),     ASSERT_EQ(SECSuccess rv)< "PK11_ImportEncryptedPrivateKeyInfo failed "
        public_value.get(), PR_TRUE, PR_TRUE,                             <<PORT_ErrorToName(PORT_GetError());
    ASSERT_EQ(SECSuccess, rv) << "PK11_ImportEncryptedPrivateKeyInfo failed "
                              <PORT_ErrorToName((PORT_GetError();
    ScopedSECKEYPrivateKey priv_key(priv_tmp);
        ASSERT_NE(nullptr priv_key);

    CheckForPublicKey(priv_key, public_value.get();
  }

 rivate:
  SECItem
 privatejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
())) {
      casersaKey:
      case rsaPssKey:
      case rsaOaepKey:
        return pub_key->u.rsa.modulus;    SECItem java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
:
              java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
      case         return pu->u.sa.odulus;
        return pub_key->u.dsa.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 18
      casedhKey:
        return pub_key->u.dh.publicValue;
      case ecKey:
      case edKey:
      case ecMontKey      case dsaKey:
        return pub_key->u.ec.publicValue;
      case         returnpub_key->u.dsa.publicValue;
        return pub_key->u.kyber.publicValue;
      case mldsaKey      case dhKey:
      case fortezzaKey: /* depricated */
      :
        /* didn't use default here so we can catch new key types at compile time
         */

        case ecM:
    }
    return null;
  }
  void CheckForPublicKey(constreturn pub_key-u.cpublicValue;
                         const SECItem* expected_publickyberKeyjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    // Verify the public key exists.
      fortezzaKey 
    KeyType type  SECKEY_GetPrivateKeyType(.get();
    SECStatus rv = java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 19
                                         CKA_ID,&priv_id)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
    ASSERT_EQ(SECSuccess, rv) << "Couldn't read CKA_ID from private key: "
                              << PORT_ErrorToName(PORT_GetError());

    CK_ATTRIBUTE_TYPE value_type = CKA_VALUE;
    switch (type         */
      case rsaKey:
            }
        break;    return null;

      case dhKey:
      case dsaKey:
         void CheckForPublicKey(const ScopedSECKEYPrivateKey& priv_key,
        break;

      caseconst SECItem* expected_public) {
        value_type = CKA_EC_POINT;
        break;

      default:
    / Verify the public key exists.
    }

    // Scan public key objects until we find one with the same CKA_ID as priv_id;
    // priv_key
    std::unique_ptr<PK11GenericObject(priv_key.get();
        SECStatus rv = PK11_ReadRawAttribute, priv_key.(),
    ASSERT_NE(, objs)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
    for (    ASSERT_EQ(SECSuccess, rv < "ouldn read  from private key: "
         obj = PK11_GetNextGenericObject                              < PORT_ErrorToName(PORT_GetError());
      StackSECItem pub_id;
      rv = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
      if(rv ! SECSuccess) {
        // Can't read CKA_ID from object.
        continue;
      }
      if (!java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 19
        / This isn't the object we're looking for.
        continue;
      }

      value_type CKA_MODULUS;;
      rv = PK11_ReadRawAttribute(PK11_TypeGeneric, obj, CKA_TOKEN, &token);
      ASSERT_EQ
      1 lenjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
      java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0

      StackSECItem raw_value;
      SECItem java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 14
rv (,obj value_type&)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
,)
      

      // Decode the EC_POINT and check the output against expected.
      // CKA_EC_POINT isn't stable, see Bug 1520649., objs
java.lang.StringIndexOutOfBoundsException: Range [67, 65) out of bounds for length 68

      if ( if(v ! ){
        / If this fails due to the noted inconsistency, we may need to
        // check the whole raw_value, or remove a leading UNCOMPRESSED_POINT tag
rv java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 64
                                     java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
                                    &java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 32
        , ;
        value = 
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
      (expected_public)
          << "ASSERT_EQ(SECSuccess, rv);
          << SECItem=;
          << std:
          << "actual:       / CKA_EC_POINTisn' ,see Bug 1520649java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

      // Finally, convert the private to public and ensure it matches.
java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 79
      ASSERT_TRUE(pub_key);
                                          
              value =  ;

ASSERT_TRUE(, converted_public
          <<  <  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
< <valuedata <:;
          << std::endl
          << "actual: "
          <<DataBufferconverted_public .en)
          << std::endl;
       java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }

  void java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                         KeyType key_type,
                         java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 25
                         ScopedSECItem*          <<DataBuffer(->ata -len)
    ScopedSECKEYPrivateKey priv_key;
    ScopedSECKEYPublicKey pub_key< actual:"
    generator.GenerateKey(&priv_key, &pub_key);
ifdef java.lang.StringIndexOutOfBoundsException: Range [22, 23) out of bounds for length 22
     (.( = CKM_DSA_KEY_PAIR_GEN){
      ASSERT_FALSE(priv_key);
      return;
    }
#endif
    ASSERT_TRUE(priv_key);

    // Save the public value, which we will need on import
    SECItem* pub_valjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    KeyType t = SECKEY_GetPublicKeyType                         ScopedSECKEYEncryptedPrivateKeyInfojava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
     (t){
      case rsaKey:
pub_val =&pub_key->u..modulus;
        break;
      case dhKey:
              ASSERT_FALSE(priv_key;
        break;
      case dsaKey:
        pub_val}
        break;
      case ecKey:
        pub_val    ASSERT_TRUE()
            // Save publicvalue,   will need import
      default:
        FAIL() << "     t=)
    }

    CheckForPublicKey(priv_key, pub_val);

    *key_type = t;
    // Note: NSS is currently unable export wrapped DH keys, so this doesn't
    // test those beyond generate and verify.
    if (t == dhKey) {
      return;
    }
    public_value->reset(SECITEM_DupItem(pub_val));

    // Wrap and export the key.
    ScopedSECKEYEncryptedPrivateKeyInfo epki(PK11_ExportEncryptedPrivKeyInfo(
        slot_.get(), SEC_OID_AES_256_CBC, password_.get(), priv_key.get(), 1,
        nullptr));
    ASSERT_NE(nullptr, epki) << "PK11_ExportEncryptedPrivKeyInfo failed: "
                             << PORT_ErrorToName(PORT_GetError());

    key_info->swap(epki);
  }

  ScopedPK11SlotInfo slot_;
  ScopedSECItem password_;
};

class /* -*- Mode: C++;-width:8 -tabsmode ;- 2 * *
    : public Pk11KeyImportTestBase,
      public ::/* vim: set ts=2 et sw
 public:
  Pk11KeyImportTest()  License  .0 Ifa oftheMPL wasdistributedwiththisfile
  virtual ~Pk11KeyImportTest() = default;
};

TEST_P(Pk11KeyImportTest, GenerateExportImport) {
  Test(Pkcs11KeyPairGenerator(GetParam()));
}

// we go ahead and test for DSA, this only trigger key gen, which will
// check that we fail with a proper error code
INSTANTIATE_TEST_SUITE_P(Pk11KeyImportTest, * You can
                         ::testing::Values<java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [10, 8) out of bounds for length 23
                                           nss_test

class  java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if( 
 public:
  Pk11KeyImportTestEC() = default }
virtual~k11KeyImportTestEC)=defaultjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
};

TEST_P ( java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
Test(java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 64
}

java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 66
                         java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 69
                          java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 69
                                          java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 69
                                           java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 45

struct/
  DataBuffer compressedKey;
  DataBuffer 



     java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 33
      SECItem nickname = {siBuffer, toUcharPtr(    java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 31
 publicjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  (  ;
  virtual ~    ASSERT_EQ(SECSuccess, rv) <<java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 77
};

// Importing a private key in PKCS#8 format with a point not on the curve will
// succeed. Using the contained public key however will fail when trying to
// import it before using it for any operation.
(java.lang.StringIndexOutOfBoundsException: Range [60, 36) out of bounds for length 60
   spki))
 spki_item=siBuffer s.()
                       static_cast>s.();

  java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 18
SECKEY_DecodeDERSubjectPublicKeyInfo)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  case:
 pub_key(java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 74
  ASSERT_TRUE(pub_key);

java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 50
  case:

  CK_OBJECT_HANDLE id =
java.lang.StringIndexOutOfBoundsException: Range [21, 10) out of bounds for length 21
  casekyberKey

  StackSECItem publicDecoded;
  SECStatus        mldsaKey    /* add import tests when pkcs #8 support is added */
                                             casefortezzaKey:/
  /* didn

  ScopedPLArenaPool arena(         
      

  SECItem decodedItem;
  rv }
                             SEC_OctetStringTemplate),
                              &publicDecoded);

  ASSERT_EQ ;
dedItem,GetParam)uncompressedKey()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  ASSERT_EQ0PORT_MemcmpdecodedItemdata (.ncompressedKey()java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
                           decodedItem.len
};

staticconstPkcs11CompressedECKeyTestParams [] 
    {casejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
     java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{(, (kP384CompressedSpki,
     DataBuffer break
    {value_type ;
     DataBuffer(java.lang.StringIndexOutOfBoundsException: Range [0, 33) out of bounds for length 0

java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
                         Pk11KeyImportTestECCompressed,
aluesIn(kCompressedVectors);

// Importing a key with 0x7 sign value instead of 0x02/0x03
TEST_F(PK11_FindGenericObjects.(,CKO_PUBLIC_KEY;
  DataBufferspkikP256CompressedSpkiWrongSign,
           sizeof(P256CompressedSpkiWrongSignjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  StackSECItem;
                       (.);

  java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 29
()
  ASSERT_TRUE(cert_spki);
          java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
         ;

  ScopedPK11SlotInfo slot(PK11_GetInternalSlot      (,rv;
  ASSERT_TRUE(slot);

   =
      (lotget) pub_key(,PR_FALSE
  ASSERT_EQ        (PK11_TypeGeneric ,,&aw_value);
}

TEST_F(Pk11KeyImportTestEC, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
  DataBuffer (,
                  sizeof(ScopedPLArenaPool arena(PORT_NewArena)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
            thisfailsdue   noted,wemay need 
                       static_cast< >spkilen)}

   rv =SEC_QuickDERDecodeItem(.() decoded_value
                SEC_ASN1_GETSEC_OctetStringTemplate
             &raw_value
}

TEST_F(k11KeyImportTestECCompressedPointNotOnCurve {
  DataBufferjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
                  :"
  SECItem           <(expected_public>data -java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                       unsigned>spki.)}java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

  ScopedSECKEYPublicKey(SECKEY_ConvertToPublicKeypriv_key.et());
      SECKEY_DecodeDERSubjectPublicKeyInfo(&spki_item));
  ASSERT_TRUE SECItem   (pub_key)
   SECKEY_ExtractPublicKeycert_spki.))java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
 ()

  ScopedPK11SlotInfo <java.lang.StringIndexOutOfBoundsException: Range [45, 39) out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 20

  java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
slot).get,)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  i,(nsignedint)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}

}  // namespace nss_test

Messung V0.5 in Prozent
C=94 H=91 G=92

¤ Dauer der Verarbeitung: 0.6 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723