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

Auto start not working,of you use Add Amnezia side-by-side with WireGuard #192

Open
tomtomclub opened this issue May 5, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@tomtomclub
Copy link

Describe the bug
A clear and concise description of what the bug is.

Smartphone (please complete the following information):

  • Device: nvidia shild pro 64 bit
  • Android Version: [droid 14/
  • App Version [e.g. prei release today

To Reproduce
Steps to reproduce the behavior:

  1. Go to Add Amnezia side-by-side with WireGuard
  2. Click on '....'
  3. Scroll down to auto starten'
  4. Reboot and is not common on

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots (Only if necessary)

Additional context
Add any other context about the problem here.

@tomtomclub tomtomclub added the bug Something isn't working label May 5, 2024
@zaneschepke
Copy link
Owner

Hello! Can you describe more what is happening? There are some comments from other users in #149 about some values that may need to be switched around.

@tomtomclub
Copy link
Author

Okay, I'm going to adjust some parameters and see what happens

@tomtomclub
Copy link
Author

It Works on mobile, not on nvidia shield, I'll test it thoroughly, don't worry

@GrumpyGiuseppe
Copy link

There is a bug in the wg tunnel amnezia config.
I tested it only with my standard wg server and changed server config.

This is my amnezia config:
Jc = 100
Jmin = 10
Jmax = 1000
S1 = 0
S2 = 0
H1 = 1
H2 = 2
H3 = 3
H4 = 4

And this is what it looks like in wg tunnel:
Jc = 100
Jmin = 10
Jmax = 1000
H1 = 1
H2 = 2
H3 = 3
H4 = 4

I guess it doesn't like 0 as input, but without there can't be a connection.

@zaneschepke
Copy link
Owner

Thanks for reporting this. I'll look into it!

@zaneschepke
Copy link
Owner

zaneschepke commented May 19, 2024

This is confusing. The problem lies in Amnezia's lib where they are setting the value to empty if it is equal to zero.

public Builder setInitPacketJunkSize(final int initPacketJunkSize) throws BadConfigException {
            if (initPacketJunkSize < 0)
                throw new BadConfigException(Section.INTERFACE, Location.INIT_PACKET_JUNK_SIZE,
                        Reason.INVALID_VALUE, String.valueOf(initPacketJunkSize));
            this.initPacketJunkSize = initPacketJunkSize == 0 ? Optional.empty() : Optional.of(initPacketJunkSize);
            return this;
        }

        public Builder setResponsePacketJunkSize(final int responsePacketJunkSize) throws BadConfigException {
            if (responsePacketJunkSize < 0)
                throw new BadConfigException(Section.INTERFACE, Location.RESPONSE_PACKET_JUNK_SIZE,
                        Reason.INVALID_VALUE, String.valueOf(responsePacketJunkSize));
            this.responsePacketJunkSize = responsePacketJunkSize == 0 ? Optional.empty() : Optional.of(responsePacketJunkSize);
            return this;
        }

I can easily change this in my fork, but I'm wondering if this is a bug or is the desired behavior by Amnezia.

@GrumpyGiuseppe
Copy link

GrumpyGiuseppe commented May 19, 2024

If you look at their post here:
https://www.reddit.com/r/AmneziaVPN/comments/1c1gsvz/amneziawg_app_for_ios_and_android/
They say: 'Any change of S and H parameters to different from what we have written will not allow you to correctly use "obfuscation".'
If I get this right, S = 0 is necessary.
The only thing I also did was adding these values to my server. That was probably the reason that the entire connection could not be established.

I don't think this is a bug.
I used your amnezia config mode with amnezia backend, but this solution should also work with the official wg app.
So in theory if I use wg tunnel without anything amnezia related and just add the values to the config it should work.
But I am not sure if wg tunnel really use these amnezia values then. (does it?)
My thought is, if I also add these values to the server they are necessary so I get a sign if the clients config is wrong.
But I am also not sure about this.

So in conclusion the best solution would be to just add an option to add the values to the regular wg config.

@zaneschepke
Copy link
Owner

If you look at their post here: https://www.reddit.com/r/AmneziaVPN/comments/1c1gsvz/amneziawg_app_for_ios_and_android/ They say: 'Any change of S and H parameters to different from what we have written will not allow you to correctly use "obfuscation".' If I get this right, S = 0 is necessary. The only thing I also did was adding these values to my server. That was probably the reason that the entire connection could not be established.

I don't think this is a bug. I used your amnezia config mode with amnezia backend, but this solution should also work with the official wg app. So in theory if I use wg tunnel without anything amnezia related and just add the values to the config it should work. But I am not sure if wg tunnel really use these amnezia values then. (does it?) My thought is, if I also add these values to the server they are necessary so I get a sign if the clients config is wrong. But I am also not sure about this.

So in conclusion the best solution would be to just add an option to add the values to the regular wg config.

I will have to change Amnezia's code to allow for the value zero. This must be a bug in their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants