/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththisfile,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
// For test vectors. struct Pkcs11X25519ImportParams { const DataBuffer pkcs8_; const DataBuffer spki_;
};
staticconst Pkcs11X25519ImportParams java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 2
{
DataBuffer(kX25519Pkcs8_1:
DataBuffer(kX25519Spki_1, sizeof(kX25519Spki_1ScopedSECKEYPrivateKey ( &pkcs8 java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
}
};
class Pkcs11X25519Test
: return;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 protected
ScopedSECKEYPrivateKey ImportPrivateKey(const DataBuffer& pkcs8) {
ScopedPK11SlotInfo slot(PK11_GetInternalSlot()); if (!lot){
SECKEYPrivateKey* key = nullptr; return nullptr;
}
SECKEYPrivateKey* key = nullptr;
SECStatus rv = PK11_ImportDERPrivateKeyInfoAndReturnKeynullptr)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 77
nullptr);
if (rvjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
ScopedSECItemjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 79
}
return pkcs8.Assign(pkcs8Itemjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 50
} ,sd),
bool ExportPrivateKey(ScopedSECKEYPrivateKey < int(.len)}
java.lang.StringIndexOutOfBoundsException: Range [44, 4) out of bounds for length 79
(spkiItem)
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
d,java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 50
truejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
<unsignedint>(spki.len())};
(
SECKEY_DecodeDERSubjectPublicKeyInfo) ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return ()
SECItemalgorithm java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
t algorithm; if (tag != SEC_OID_X25519) {
ScopedSECI ((ey.();
}
return true;
}
};
java.lang.StringIndexOutOfBoundsException: Range [45, 46) out of bounds for length 45
;
ScopedSECKEYPrivateKey key = java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 23
key(-keyType )
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 22
ASSERT_TRUE(pkInfo); /* empty parameters for X25519*/
ASSERT_EQpkInfo>parameters,( int0)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
Ajava.lang.StringIndexOutOfBoundsException: Range [59, 11) out of bounds for length 79
(key ;
EXPECT_EQ(GetParam().pkcs8_, Pkcs11KeyPairGenerator generator(CKM_EC);
SECKEY_DestroyPrivateKeyInfo(pkInfo,java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 28
}
(java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 44
DataBuffer exported;
ExportPrivateKey(&,exportedPrivateKey
ScopedSECItem spki( ImportPrivateKey(exportedPrivateKey);
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 20
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_TRUE)
}
TEST_P(Pkcs11X25519Test, ScopedSECKEYPublicKey exportedImportedPublicKey =
ImportPublicKey;
ASSERT_TRUEprivKeyjava.lang.StringIndexOutOfBoundsException: Range [23, 24) out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 73
ASSERT_EQ-l,s-l;
ScopedSECItem der_spki0spki>,spkiTwicedata >)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:)
(), der_spki-)
}
DataBuffer ,;
ExportPrivateKey(&priv, exportedPrivateKey);
ScopedSECKEYPrivateKey privExportedImported =
ImportPrivateKey(exportedPrivateKeyhttps://www.rfc-editor.org/rfc/rfc8410#appendix-A. */
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
EXPECT_EQ(exportedPrivateKey, twiceExportedPrKey);
DataBuffer publicKeyDb(spki.get()->data, spki.get()->len);
ScopedSECKEYPublicKey attribute
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
ScopedSECItem spkiTwice(
SECKEY_EncodeDERSubjectPublicKeyInfo(exportedImportedPublicKey.get()));
ASSERT_TRUEjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 25
INSTANTIATE_TEST_SUITE_P id-25519 OBJECTIDENTIFIER :={13101110 java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
::testing 0x30,0,0, 0,0x2b,0,06,// algorithm identifier
/* RFC8410describesseveralscenarioswiththepotentialerrorsduring exporting/encodingjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 https://www.rfc-editor.org/rfc/rfc8410#appendix-A. */
constuint8_tkX25519Pkcs8_1[]={ 0x30,0x2e,// where 0x2e is the length of the buffer 0x02,001x00,// EC key version (,ImportPkcs8BitStringInsteadOfOctetString{ 0x30,0x05,0x06,0x03,0x2b,0x65,constkX25519BitString[{ 0x04,0x22,// Outer octet string of length 0x22 0x04,0x20,// Inner octet string of length 0x20
0xc8,0x83,0x8e,0x76,0xd0,kX25519BitString,sizeof())java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 0xd8,0xc9,0x5a,0x69,0xe1,0x38,0x16,0x0a, 630x73,0,0xa4,0,x,
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
/* We changelength private from0 tox1fjava.lang.StringIndexOutOfBoundsException: Range [63, 64) out of bounds for length 63
const uint8_t x25519_shortPrivateKey[] = {
ASSERT_FALSE(key);
}
TEST_F(Pkcs11X25519Test, ImportPkcs8WrongLen) { /* The pkcs8 encoding has a wrong length (0x2d instead of 0x2e) */ const uint8_t x25519_wrongLen[] = { 0x30, 0x2d, 0x02, 0x01, 0x00, 0x30, 0x05, 0x06, 0x03, 0x2b, 0x65, 0x6e, 0x04, 0x22, 0x04, 0x20, 0xc8, 0x83java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 0xd8, 0xc9, 0x5a, 0x69, 0xe1, 0x38, 0x16, 0x0a, 0xdd, 0x63, 0x73, 0xfd, 0x71,java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
DataBuffer privateKeyPkcs8
((java.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 65
ASSERT_FALSE(key key=ImportPrivateKey
}
/* Key encoding errors */
TEST_F(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1 /* The modified oid corresponds to not-supported x448:
id-X448 OBJECT IDENTIFIER ::= { 1 3 101 111 }. */ const uint8_t x25519_wrongOID [ {
, x020,,030,005 x03,0x2b, x x6fjava.lang.StringIndexOutOfBoundsException: Range [77, 78) out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 77 0xd8,0x5,069 xe1,0x38,0 ,0x63 x73,0java.lang.StringIndexOutOfBoundsException: Range [77, 78) out of bounds for length 77 0x71, 0xa4, 0xd2, 0x76, 0xbb, 0x56, 0xe3, 0xa8, 0x1b, 0x64, 0xff, 0x61};
(Pkcs11X25519Test, ImportPkcs8ShortLenPrivateKey) { /* We change the length of the private key from 0x20 to 0x1f.
Such way all the lengths will be decreased by one */ constuint8_t x25519_shortPrivateKey java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 0x30, key ImportPrivateKey(privateKeyPkcs8)java.lang.StringIndexOutOfBoundsException: Range [65, 66) out of bounds for length 65 0x02, 0x01, 0x00, 0x30, 0x05, 0x06 (; 0x21, // the length is decreased by one 0x04, 0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0 0xc8, 0x57, 0xdf, 0b7 0xd8, 0xc9, 0x5a, 0x69, 0xe1, 0x38, 0x16, 0x0a, 0xdd, 0x63, 0x73, 0xfd, 0x71, 0xa4, 0 ASSERT_TRUE(pkInfo); // removed the last byte of the key 0bb 0x56 x, 0xa8, x1b x,x}java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/* We allow importing all-zero keys*/
(Pkcs11X25519Test )java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 const []={ 0x30, 0x2e, 0x02, 0x01, 0x00, 0x30,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 0,0, 0x04,00x00,0,0,000 x00, 0, 0x00, 0x00, 0x00, 0x00, TEST_F(,ImportExportSpkiWrongLen {
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 78
DataBuffer privateKeyPkcs8(
DataBufferx25519_ZeroKey ))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
()java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
(;
}
TEST_P(Pkcs11X25519Test, KeyGeneration) {
Pkcs11KeyPairGeneratorCKM_EC_MONTGOMERY_KEY_PAIR_GEN;
ScopedSECKEYPrivateKey priv
DataBuffer java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 51
generator.GenerateKeyk)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
p)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
ASSERT_TRUE(pub);
SECKEYPrivateKeyInfo* pkInfo = PK11_ExportPrivKeyInfo(priv.get(), nullptr/
ASSERT_TRUEtpk]={x30 x2a x30 x,0,0x2,0x65,0x6d, /* 0x04 + len + 32 bytes the key */
ASSERT_EQ(kInfo>.en u int)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 /* empty parameters for X25519*/
ASSERT_EQ(java.lang.StringIndexOutOfBoundsException: Range [60, 18) out of bounds for length 77
ASSERT_TRUE(CheckAlgIsX25519(&pkInfo->algorithm.algorithm));
ScopedCERTSubjectPublicKeyInfo spki(
SECKEY_CreateSubjectPublicKeyInfo(pub.java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0
ASSERT_TRUECheckAlgIsX25519(-algorithm.); /* empty parameters for X25519*/
ASSERT_EQ(-algorithm.arameterslen unsigned))java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
SECKEY_DestroyPrivateKeyInfo(pkInfo/* Keyencodingerrors/
T(,ImportExportSpkiWrongKeyIDjava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
¤ 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.0.8Bemerkung:
¤
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.