Remove check for v length
This commit is contained in:
@@ -24,7 +24,6 @@
|
||||
|
||||
#define MAX_INT256 32
|
||||
#define MAX_ADDRESS 20
|
||||
#define MAX_V 4
|
||||
|
||||
void initTx(txContext_t *context,
|
||||
cx_sha3_t *sha3,
|
||||
@@ -255,6 +254,10 @@ static void processTo(txContext_t *context) {
|
||||
}
|
||||
|
||||
static void processData(txContext_t *context) {
|
||||
PRINTF("DATA len: %d, DATA: %.*H\n",
|
||||
context->currentFieldLength,
|
||||
context->currentFieldLength,
|
||||
context->workBuffer);
|
||||
if (context->currentFieldIsList) {
|
||||
PRINTF("Invalid type for RLP_DATA\n");
|
||||
THROW(EXCEPTION);
|
||||
@@ -275,6 +278,7 @@ static void processData(txContext_t *context) {
|
||||
}
|
||||
|
||||
static void processAndDiscard(txContext_t *context) {
|
||||
PRINTF("DISCARDING: %.*H\n", context->currentFieldLength, context->workBuffer);
|
||||
if (context->currentFieldIsList) {
|
||||
PRINTF("Invalid type for Discarded field\n");
|
||||
THROW(EXCEPTION);
|
||||
@@ -291,14 +295,14 @@ static void processAndDiscard(txContext_t *context) {
|
||||
}
|
||||
|
||||
static void processV(txContext_t *context) {
|
||||
PRINTF("current Length: %d\tBuff: %.*H\n",
|
||||
context->currentFieldLength,
|
||||
context->currentFieldLength,
|
||||
context->workBuffer);
|
||||
if (context->currentFieldIsList) {
|
||||
PRINTF("Invalid type for RLP_V\n");
|
||||
THROW(EXCEPTION);
|
||||
}
|
||||
if (context->currentFieldLength > MAX_V) {
|
||||
PRINTF("Invalid length for RLP_V\n");
|
||||
THROW(EXCEPTION);
|
||||
}
|
||||
if (context->currentFieldPos < context->currentFieldLength) {
|
||||
uint32_t copySize =
|
||||
MIN(context->commandLength, context->currentFieldLength - context->currentFieldPos);
|
||||
|
||||
@@ -26,13 +26,12 @@ uint32_t get_chain_id(void) {
|
||||
|
||||
switch (txContext.txType) {
|
||||
case LEGACY:
|
||||
chain_id = u32_from_BE(txContext.content->v, txContext.content->vLength, true);
|
||||
chain_id = u32_from_BE(txContext.content->v, txContext.content->vLength);
|
||||
break;
|
||||
case EIP2930:
|
||||
case EIP1559:
|
||||
chain_id = u32_from_BE(tmpContent.txContent.chainID.value,
|
||||
tmpContent.txContent.chainID.length,
|
||||
true);
|
||||
tmpContent.txContent.chainID.length);
|
||||
break;
|
||||
default:
|
||||
PRINTF("Txtype `%d` not supported while generating chainID\n", txContext.txType);
|
||||
|
||||
Reference in New Issue
Block a user