Skip to content

"Invalid destination key" when trying to recover previously used session #21

@a-0-dev

Description

@a-0-dev

I'm trying to store a session (or, its destination) for later reuse, so my b32 address doesn't change all the time. However, this fails with the error "Invalid destination key: " (yes, nothing follows after that colon), which means an invalid key error is returned by the router.

I wrote the following test to reproduce this issue:

#[test]
pub fn from_destination() {
    // Build an I2pListener with a "TRANSIENT" session
    let listener1 = I2pListenerBuilder::default()
        .with_options(SAMOptions::default())
        .build()
        .expect("Failed to build listener1");

    // Extract listener1's `destination`
    let listener1_dest = listener1
        .local_addr()
        .expect("Failed to get local address of listener1")
        .dest()
        .string();

    // Attempt to build a new I2pListener, recovering the previous session
    let listener2 = I2pListener{
        forward: StreamForward::with_session(&Session::from_destination(
            i2p::sam::DEFAULT_API, 
            &listener1_dest, 
            SAMOptions::default()).expect("Failed to create session for listener2")
        ).expect("Failed to create StreamForward for listener2")
    };

}

To be honest, I have no idea what's happening. I traced i2p-rs's code and the value of listener1_dest seems to be exactly what is replied by the router in Session::naming_lookup - thus should be a valid destination with bells and whistles.

This may be a router issue just as well as an i2p-rs issue...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions