Opened 2 years ago

Closed 2 years ago

#22987 closed defect (fixed)

TAP Hybrid Encryption case 1 is used when the payload is equal to the maximum length

Reported by: teor Owned by: teor
Priority: Medium Milestone: Tor: 0.3.2.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor-spec
Cc: Actual Points:
Parent ID: #18856 Points:
Reviewer: Sponsor:

Description

The spec says:

-      1. If M is less than PK_ENC_LEN-PK_PAD_LEN, pad and encrypt M with PK.
+      1. If M is less than or equal to PK_ENC_LEN-PK_PAD_LEN, pad and encrypt M with PK.

https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt#n117

(We'll need to fix the line wrapping here as well.)

But the code does:

  if (!force && fromlen+overhead <= pkeylen) {

https://gitweb.torproject.org/tor.git/tree/src/common/crypto.c#n1262

Child Tickets

Change History (3)

comment:1 Changed 2 years ago by teor

Status: newneeds_review

comment:2 Changed 2 years ago by nickm

I've made this change, and some others, in c444e527a05314cad6ef1e39d31ad7e74cc2f018

comment:3 Changed 2 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

See also #23026

Note: See TracTickets for help on using tickets.