mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Use wc_ prefix for IndexSequenceOf()
This commit is contained in:
@@ -179,7 +179,7 @@ int test_SetShortInt(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int test_IndexSequenceOf(void)
|
int test_wc_IndexSequenceOf(void)
|
||||||
{
|
{
|
||||||
EXPECT_DECLS;
|
EXPECT_DECLS;
|
||||||
|
|
||||||
@@ -200,23 +200,23 @@ int test_IndexSequenceOf(void)
|
|||||||
const byte * element;
|
const byte * element;
|
||||||
word32 elementSz;
|
word32 elementSz;
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(int_seq, sizeof(int_seq), 0U, &element, &elementSz), 0);
|
ExpectIntEQ(wc_IndexSequenceOf(int_seq, sizeof(int_seq), 0U, &element, &elementSz), 0);
|
||||||
ExpectPtrEq(element, &int_seq[2]);
|
ExpectPtrEq(element, &int_seq[2]);
|
||||||
ExpectIntEQ(elementSz, 3);
|
ExpectIntEQ(elementSz, 3);
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(int_seq, sizeof(int_seq), 1U, &element, &elementSz), 0);
|
ExpectIntEQ(wc_IndexSequenceOf(int_seq, sizeof(int_seq), 1U, &element, &elementSz), 0);
|
||||||
ExpectPtrEq(element, &int_seq[5]);
|
ExpectPtrEq(element, &int_seq[5]);
|
||||||
ExpectIntEQ(elementSz, 4);
|
ExpectIntEQ(elementSz, 4);
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(int_seq, sizeof(int_seq), 2U, &element, &elementSz), 0);
|
ExpectIntEQ(wc_IndexSequenceOf(int_seq, sizeof(int_seq), 2U, &element, &elementSz), 0);
|
||||||
ExpectPtrEq(element, &int_seq[9]);
|
ExpectPtrEq(element, &int_seq[9]);
|
||||||
ExpectIntEQ(elementSz, 3);
|
ExpectIntEQ(elementSz, 3);
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(int_seq, sizeof(int_seq), 3U, &element, &elementSz), WC_NO_ERR_TRACE(BAD_INDEX_E));
|
ExpectIntEQ(wc_IndexSequenceOf(int_seq, sizeof(int_seq), 3U, &element, &elementSz), WC_NO_ERR_TRACE(BAD_INDEX_E));
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(bad_seq, sizeof(bad_seq), 0U, &element, &elementSz), WC_NO_ERR_TRACE(ASN_PARSE_E));
|
ExpectIntEQ(wc_IndexSequenceOf(bad_seq, sizeof(bad_seq), 0U, &element, &elementSz), WC_NO_ERR_TRACE(ASN_PARSE_E));
|
||||||
|
|
||||||
ExpectIntEQ(IndexSequenceOf(empty_seq, sizeof(empty_seq), 0U, &element, &elementSz), WC_NO_ERR_TRACE(BAD_INDEX_E));
|
ExpectIntEQ(wc_IndexSequenceOf(empty_seq, sizeof(empty_seq), 0U, &element, &elementSz), WC_NO_ERR_TRACE(BAD_INDEX_E));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return EXPECT_RESULT();
|
return EXPECT_RESULT();
|
||||||
|
@@ -25,10 +25,10 @@
|
|||||||
#include <tests/api/api_decl.h>
|
#include <tests/api/api_decl.h>
|
||||||
|
|
||||||
int test_SetShortInt(void);
|
int test_SetShortInt(void);
|
||||||
int test_IndexSequenceOf(void);
|
int test_wc_IndexSequenceOf(void);
|
||||||
|
|
||||||
#define TEST_ASN_DECLS \
|
#define TEST_ASN_DECLS \
|
||||||
TEST_DECL_GROUP("asn", test_SetShortInt), \
|
TEST_DECL_GROUP("asn", test_SetShortInt), \
|
||||||
TEST_DECL_GROUP("asn", test_IndexSequenceOf)
|
TEST_DECL_GROUP("asn", test_wc_IndexSequenceOf)
|
||||||
|
|
||||||
#endif /* WOLFCRYPT_TEST_ASN_H */
|
#endif /* WOLFCRYPT_TEST_ASN_H */
|
||||||
|
@@ -2586,7 +2586,7 @@ int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
|
|||||||
* @return BAD_INDEX_E when the given seqIndex is out of range.
|
* @return BAD_INDEX_E when the given seqIndex is out of range.
|
||||||
* @return ASN_PARSE_E when the seqOf is not in the expected format.
|
* @return ASN_PARSE_E when the seqOf is not in the expected format.
|
||||||
*/
|
*/
|
||||||
int IndexSequenceOf(byte const * seqOf, word32 seqOfSz, size_t seqIndex,
|
int wc_IndexSequenceOf(byte const * seqOf, word32 seqOfSz, size_t seqIndex,
|
||||||
byte const ** out, word32 * outSz)
|
byte const ** out, word32 * outSz)
|
||||||
{
|
{
|
||||||
int length;
|
int length;
|
||||||
|
@@ -15335,8 +15335,8 @@ static int wc_PKCS7_DecodeSymmetricKeyPackage(const byte * skp, word32 skpSz,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* sKeyPkgAttrs is present at &skp[skpIndex], length in length */
|
/* sKeyPkgAttrs is present at &skp[skpIndex], length in length */
|
||||||
return IndexSequenceOf(&skp[skpIndex], (word32)length, index, out,
|
return wc_IndexSequenceOf(&skp[skpIndex], (word32)length, index,
|
||||||
outSz);
|
out, outSz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15346,7 +15346,8 @@ static int wc_PKCS7_DecodeSymmetricKeyPackage(const byte * skp, word32 skpSz,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* sKeys is present at &skp[skpIndex]. */
|
/* sKeys is present at &skp[skpIndex]. */
|
||||||
return IndexSequenceOf(&skp[skpIndex], skpSz - skpIndex, index, out, outSz);
|
return wc_IndexSequenceOf(&skp[skpIndex], skpSz - skpIndex, index,
|
||||||
|
out, outSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(const byte * skp,
|
int wc_PKCS7_DecodeSymmetricKeyPackageAttribute(const byte * skp,
|
||||||
@@ -15384,7 +15385,7 @@ int wc_PKCS7_DecodeOneSymmetricKeyAttribute(const byte * osk,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Index the sKeyAttrs SEQUENCE OF object with the given index. */
|
/* Index the sKeyAttrs SEQUENCE OF object with the given index. */
|
||||||
return IndexSequenceOf(&osk[oskIndex], oskSz - oskIndex, index, attr,
|
return wc_IndexSequenceOf(&osk[oskIndex], oskSz - oskIndex, index, attr,
|
||||||
attrSz);
|
attrSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2219,7 +2219,7 @@ WOLFSSL_LOCAL int GetSequence(const byte* input, word32* inOutIdx, int* len,
|
|||||||
word32 maxIdx);
|
word32 maxIdx);
|
||||||
WOLFSSL_LOCAL int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
|
WOLFSSL_LOCAL int GetSequence_ex(const byte* input, word32* inOutIdx, int* len,
|
||||||
word32 maxIdx, int check);
|
word32 maxIdx, int check);
|
||||||
WOLFSSL_TEST_VIS int IndexSequenceOf(byte const * seqOf, word32 seqOfSz,
|
WOLFSSL_TEST_VIS int wc_IndexSequenceOf(byte const * seqOf, word32 seqOfSz,
|
||||||
size_t seqIndex, byte const ** out, word32 * outSz);
|
size_t seqIndex, byte const ** out, word32 * outSz);
|
||||||
WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
|
WOLFSSL_LOCAL int GetOctetString(const byte* input, word32* inOutIdx, int* len,
|
||||||
word32 maxIdx);
|
word32 maxIdx);
|
||||||
|
Reference in New Issue
Block a user