File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -707,6 +707,21 @@ func (r *Router) ProcessOnionPacket(onionPkt *OnionPacket,
707707 return packet , nil
708708}
709709
710+ // ReconstructOnionPacket rederives the subsequent onion packet.
711+ // NOTE: This method does not do any sort of replay protection, and should only
712+ // be used to reconstruct packets that were successfully processed previously.
713+ func (r * Router ) ReconstructOnionPacket (onionPkt * OnionPacket ,
714+ assocData []byte ) (* ProcessedPacket , error ) {
715+
716+ // Compute the shared secret for this onion packet.
717+ sharedSecret , err := r .generateSharedSecret (onionPkt .EphemeralKey )
718+ if err != nil {
719+ return nil , err
720+ }
721+
722+ return processOnionPacket (onionPkt , & sharedSecret , assocData )
723+ }
724+
710725// processOnionPacket performs the primary key derivation and handling of onion
711726// packets. The processed packets returned from this method should only be used
712727// if the packet was not flagged as a replayed packet.
You can’t perform that action at this time.
0 commit comments