Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Network-Byte Order #3

Open
ritzdorf opened this issue Jan 31, 2018 · 6 comments
Open

No Network-Byte Order #3

ritzdorf opened this issue Jan 31, 2018 · 6 comments

Comments

@ritzdorf
Copy link

tlsproof_hash_op_nbo(PK11Context *ctx, const void* inbuf, const PRUint32 inbuf_len){

@FDeRubeis
Copy link

if(tlsproof_hash_begin2(ctx) != SECSuccess) return SECFailure;

@FDeRubeis
Copy link

evMsg.timeStampStart = ss->tlsproofTimeStampStart;
evMsg.timeStampStop = timeStampStop;
// Length of Signature
evMsg.sig_len = signature.len;
// Length of ordering vector
evMsg.orderingVectorLen = ss->tlsproofOrderingVectorLen;
offset = 0;
WRITE_LEN_AT_OFFSET(response, offset, &message_type, TLS_PROOF_MESSAGE_TYPE_SIZE);
// Add Struct
WRITE_LEN_AT_OFFSET(response, offset, &evMsg, EVIDENCE_MESSAGE_SIZE);
// Add Signature
PORT_Memcpy(response+offset, signature.data, signature.len);
offset += signature.len;
// Add Ordering Vector
PORT_Memcpy(response+offset, ss->tlsproofOrderingVector, ceil_div8(ss->tlsproofOrderingVectorLen));
offset += ceil_div8(ss->tlsproofOrderingVectorLen);

@FDeRubeis
Copy link

sig.data = response+offset;
offset += evMsg.sig_len;
// Ordering Vector
orderingVector = response+offset;
offset += ceil_div8(evMsg.orderingVectorLen);
PORT_Assert(offset == origBuf->len);
sig.len = evMsg.sig_len;
sig.type = siBuffer;

@FDeRubeis
Copy link

proofPar.hash_size = hash_size;
proofPar.salt_size = ss->xtnData.salt_size;
proofPar.chunk_size = ss->xtnData.chunk_size;

@FDeRubeis
Copy link

proofPar.num_proof_nodes = 2;
PORT_Assert(evMsg.orderingVectorLen >= 2);
} else if (ss->tlsProofType & last_message_proof){
proofPar.num_proof_nodes = 2;
PORT_Assert(evMsg.orderingVectorLen >= 2);

@FDeRubeis
Copy link

ProofSalt *salt_locs = (ProofSalt*) PORT_Alloc(hiddenPlaintextNode.num_salts * sizeof(ProofSalt));

for(i = 0; i < hiddenPlaintextNode.num_salts; ++i){

PRUint8** proof_salts = (PRUint8**) PORT_Alloc(hiddenPlaintextNode.num_salts * sizeof(PRUint8*));

for(i = 0; i < hiddenPlaintextNode.num_salts; ++i){

ProofMerkleNode *hash_locs = (ProofMerkleNode *) PORT_Alloc(hiddenPlaintextNode.num_hashes * sizeof(ProofMerkleNode));
for(i = 0; i < hiddenPlaintextNode.num_hashes; ++i){

proof_offset += proofPar.salt_size;

proof_offset += proofPar.hash_size;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants