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

特殊密码会报错message authentication failed #2705

Closed
amano0-0 opened this issue Apr 13, 2021 · 5 comments · Fixed by shadowsocks/crypto2#20
Closed

特殊密码会报错message authentication failed #2705

amano0-0 opened this issue Apr 13, 2021 · 5 comments · Fixed by shadowsocks/crypto2#20
Labels

Comments

@amano0-0
Copy link

amano0-0 commented Apr 13, 2021

Describe the bug
使用下面这个密码会导致服务端报错,详细报错见ScreenShots部分。
罪魁祸首:
"Imakethis_LongPassPhraseFor_safety_2019_0928@_@!"

To Reproduce
使用v2fly server:

{
"log": {
"loglevel": "debug",
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log"
    },
    "routing": {
        "domainStrategy": "AsIs",
        "rules": [
            {
                "type": "field",
                "ip": [
                    "geoip:private"
                ],
                "outboundTag": "block"
            }
        ]
    },
    "inbounds": [
        {
            "listen": "0.0.0.0",
            "port": 1234,
            "protocol": "shadowsocks",
            "settings": {
                "method": "chacha20-ietf-poly1305",
                "password": "Imakethis_LongPassPhraseFor_safety_2019_0928@_@!"
        },
            "streamSettings": {
                "network": "tcp"
            }
        }
    ],
    "outbounds": [
        {
            "protocol": "freedom",
            "tag": "direct"
        },
        {
            "protocol": "blackhole",
            "tag": "block"
        }
    ]
}

Screenshots
服务端报错:

2021/04/14 04:05:44 192.168.1.23:42844 rejected github.com/v2fly/v2ray-core/v4/proxy/shadowsocks: failed to read address > chacha20poly1305: message authentication failed
2021/04/14 04:05:44 192.168.1.23:42846 rejected github.com/v2fly/v2ray-core/v4/proxy/shadowsocks: failed to read address > chacha20poly1305: message authentication failed

客户端行为:
只有发送流量没有接受流量。过段时间后会报错cp.cloudflare没法正常resolve的字样

Smartphone (please complete the following information):

  • Android/Chrome OS version: LineageOS
  • Device: Redmi Note5
  • Version: v5.2.2
  • Last version that did not exhibit the issue: [not applicable]

Additional context
去掉感叹号后就没问题了。
因为同样的密码,使用ss windows和旧版ss Android 5.1.7连接即使带感叹号也正常。所以怀疑是ss安卓这边的原因,就到这里提issue了
第一次在本地机子测试的时候使用的"test@_@!"做密码却也正常连通。

@amano0-0 amano0-0 added the bug label Apr 13, 2021
@zonyitoo
Copy link

I tested with shadowsocks-rust's sslocal:

{
    "password": "Imakethis_LongPassPhraseFor_safety_2019_0928@_@!"
}

and it can read it properly:

2021-04-14T07:38:46.990969+08:00 TRACE [73791:4447292928] [shadowsocks_service::local] Config { server: [ServerConfig { addr: SocketAddr(127.0.0.1:8288), password: "Imakethis_LongPassPhraseFor_safety_2019_0928@_@!", method: AES_128_GCM, enc_key: [75, 1, 162, 215, 98, 250, 218, 158, 222, 77, 16, 52, 161, 61, 198, 156], timeout: None, plugin: None, plugin_addr: None, remarks: None, id: None, mode: TcpAndUdp }], local_addr: None, local: [LocalConfig { addr: SocketAddr(127.0.0.1:1300), protocol: Socks, mode: TcpAndUdp, udp_addr: None, forward_addr: None }], dns: System, ipv6_first: false, no_delay: false, nofile: None, outbound_bind_interface: None, inbound_send_buffer_size: None, inbound_recv_buffer_size: None, outbound_send_buffer_size: None, outbound_recv_buffer_size: None, manager: None, config_type: Local, udp_timeout: Some(10s), udp_max_associations: Some(10), acl: None }

@zonyitoo
Copy link

zonyitoo commented Apr 14, 2021

Can reproduce with:

# shadowsocks-rust local
$ sslocal -b 127.0.0.1:1080 -s 127.0.0.1:8388 -k 'Imakethis_LongPassPhraseFor_safety_2019_0928@_@!' -m 'chacha20-ietf-poly1305'

# shadowsocks-libev server
$ ss-server -s 127.0.0.1 -p 8388 -k 'Imakethis_LongPassPhraseFor_safety_2019_0928@_@!' -m 'chacha20-ietf-poly1305'

It should be a BUG.

There must be something wrong in shadowsocks-rust's openssl_bytes_to_key.

# shadowsocks-rust
75, 1, 162, 215, 98, 250, 218, 158, 222, 77, 16, 52, 161, 61, 198, 156, 99, 235, 48, 219, 144, 110, 60, 222, 165, 177, 104, 123, 236, 54, 131, 137

# shadowsocks-libev
75, 1,1 62, 215, 98, 250, 218, 158, 222, 77, 16, 52, 161, 61, 198, 156, 59, 82, 139, 115, 130, 54, 185, 156, 211, 164, 114, 210, 147, 53, 128, 214

It differs from offset 17.

@DuckSoft
Copy link

Upstream bug (crypto2 md5):
图片
图片

Reported.

@zonyitoo
Copy link

Bug confirmed in crypto2, will be fixed by shadowsocks/crypto2@bb3dd2c

@zonyitoo
Copy link

fixed in shadowsocks-rust v1.10.6. Please @madeye update to this version.

@madeye madeye closed this as completed in 181ef53 Apr 18, 2021
JackyAnn added a commit to JackyAnn/shadowsocks-android that referenced this issue Sep 22, 2022
* Allow user to keep data when uninstalling (shadowsocks#2506)

* Update README.md

* Update dependencies

* Add cargo clean task

* Enable LTO

* Speed up rebuild

* Update issue templates with labels

* Update dependencies

* Fix output name second attempt

* Update NDK

* Ensure cargoBuild is ran before mergeJniLibFolders

* Bump version

* Refine release build process

* Refine gradle files

* Add RUST_BACKTRACE

* Use rethrowAsSocketException

* Suppress write errors to protect_path

* Update shadowsocks-rust

* Bump version

* Improve accessibility

* Rename cipher plain to none

* Revert "Add RUST_BACKTRACE"

This reverts commit fdff88e.

ndk-stack should be used instead.

* Use cp.cloudflare.com for connectivity test

Credits: https://www.v2ex.com/t/656983#r_8748918

* Update dependencies

* Remote DNS setting is enabled unconditionally

* Show more information on conflicting plugins

Because one of you feckers just cannot learn to be decent.

* Add support for PTR queries

* Prevent querying PTR on custom Network

* Suppress network unspecified exceptions

* Handle IOException while reading

* Refine handling duplicate plugins

* Use any address as default DNS

* Suppress EACCES for ProtectWorker

* Clean up unused code

* Do not suppress IOException

* Disable UDP relay if plugin is enabled and no fallback

* Remove unnecessary isExperimental

* Update dependencies

* Fix unchecked cast

* Do not use WorkManager in device storage

* Remove unnecessary directBootAware overloading

* Suppress BadConfigurationProvider

* Disable RemoveWorkManagerInitializer lint for apps

* Update to Android 11 beta 1

* Request QUERY_ALL_PACKAGES for mobile

* Refine code style

* Fix ambiguous coroutineContext

* Downgrade coroutines

* Update dependencies

* Deprecate using Handler

* Fix shadowsocks#2546

* Only match exported plugins

* Update dependencies

* Update dependencies

* Migrate to ML kit for scanning QR code

Fixes shadowsocks#2548.

* Make scanner immersive

* Lock orientation to prevent camera recreation

* Fix missing Serializable declaration

* Add missing serialVersionUID

* Update dependencies

* Partially migrate to ActivityResultContracts

AlertDialogFragment will be migrated after the API goes stable.

* Add ActionBar to oss activity

* Add ActionBar to details activity

* Refine Scanner

* Bump version

* Update dependencies

* Suppress cancellation exceptions

* Skip processing if EOS is reached

* Refine PTR compat

* Fix shadowsocks#2557

* Fix shadowsocks#2562

* Update Android gradle

* Set VPN flag properly

Refine shadowsocks#2562.

* Drop support for Android Lollipop

* Update dependencies

* Remove UDP upstream DNS support. Fix shadowsocks#2564 shadowsocks#2518

* Update shadowsocks-rust

* Update dependencies

* Decouple main dependencies from plugin lib

* Simplify code

* Add missing type

* Update dependencies

* Deprecate old backup mechanism for Android 5-

* Update leanback theme to appcompat

* Use singleTask launchMode

* Fix build

* Bump version

* Update dependencies

* Update dependencies

* Bump plugin lib version to 2.0.0

* Add isV2 to PluginManager.InitResult

* Pass a value with the VPN option, if plugin version < 2.0

* Switch to __android_vpn

* Remove unnecessary parentheses

* Update shadowsocks-rust

* Bump version

* Clean up and bump version

* Revert camera-view back to alpha17

* Bump version

* Update dependencies

* Migrate away from deprecated APIs with core 1.3.0-alpha05

* Clean up code

* Refine code style

* Remove old ciphers. Fix shadowsocks#2621

* Enable single-threaded

* Update shadowsocks-rust to 1.8.23

* Use Parcelize for TrafficStats

* Fix platform insets on API 29-

* Fix shadowsocks#2623

* Update barcode-scanning

* Fix shadowsocks#2571

* Refine error message

* Refine shadowsocks#2571

* Limit open sockets to 256 in UDP association. Fix shadowsocks#2625

* Bump version

* Fix little problem of profile switching

* Update shadowsocks-rust to 1.9.0 (shadowsocks#2622)

* Fix shadowsocks#2638

* Bump version

* Switch to local UDP DNS resolver (shadowsocks#2635)

* Switch to the local UDP DNS resolver

* Update shadowsocks-rust

* Revert the rustup commands

* Fix shadowsocks#2642

* Fix the ByteBuffer allocation

* Update shadowsocks-rust

* Revert to local UDS resolver

Fix shadowsocks#2650

* Check deprecated ciphers (shadowsocks#2651)

* Bump version

* Fix shadowsocks#2301

* Bump version

* Remove the non-ietf chacha20 and salsa20 ciphers

* Fix shadowsocks#2665

* Update dependencies

* Fix deprecation of kotlin extensions

* Remove unused gcm work library for API 23+

* Use work-multiprocess

* Refine code style

* Update dependencies (shadowsocks#2672)

* Update dependencies

* Refine code style

* Bump gradle to 6.8.2

* Drop packet if out of buffer

* Refine error message

* Enlarge the buffer size of a UDP connection

* Bump version

* Ignore all exceptions whilst updating subscriptions

* Refine the JSON config file for ss-rust 1.10

* Refine the code style

* Update shadowsocks-rust to v1.10.3

* Fix shadowsocks#2679

* Update dependencies

Fixes shadowsocks#2699.

* Fix deprecation of adapterPosition

* Bump plugin to 2.0.1

* Migrate AlertDialogFragment to fragment result API

* Remove useless dependency update

* Migrate the rest to fragment result API

* Remove unused field

* Prevent crashing on shitty ROMs

* Add search tool for profiles (shadowsocks#2682)

* Suppress logging unsupported query type errors

* Ignore if connection was prematurely closed

* Use default udp_timeout=300 instead

Refine shadowsocks#2625.

* Mark underlyingNetwork as volatile

Attempts at addressing shadowsocks#2667.

* Fixed required targetFragments for preference

* Downgrade gradle plugin

* Update shadowsocks-rust and add back some ciphers

Fix shadowsocks#2705 and shadowsocks#2663.

* Update dependencies

* Check plugin properly

Fix shadowsocks#2667.

* Check crypto before init

* Make code style more Kotlin

* Update core and remove workaround

* Refine search to respect locale

* Double fixes touch target

* Resolve server name dynamically always (shadowsocks#2731)

Fixes shadowsocks#2722.

* Bump version

* Downgrade fragment to 1.3.2

Fixes shadowsocks#2733.

* Make plugin library depend on minimum version instead

* Enable Parallel GC

* Set useLegacyPackaging

* Update the maven publish plugin (shadowsocks#2734)

1. Remove the unnecessary custom URL
2. Replace jcenter with mavenCentral

* Handle illegal profiles properly

* Fix windows build failed shadowsocks#2666 shadowsocks#2711

* Allowed build under msys2 or cygwin

* Update dependencies

* Bring back semitransparent TV app via build variants (shadowsocks#2741)

This creates two variants for tv, freedom containing the original design, and google containing one matching Google's nonsense guideline. The former should be published on GitHub and elsewhere.

Revert "Revert "Revert "Revert "Revert "Make app fullscreen to match guidelines"""""

This reverts commit 0c67ac6.

* Fix typo

* Show full proxied apps mode to compensate for missing title

* Use MaterialAlertDialogBuilder

* Add progress indicator to ServiceButton

* Remove elevation from progress

* Only show progress for connecting

* Only show progress when connecting is taking too long

* Bump version

* Update dependencies

* Update sdk to S

* Use registerBestMatchingNetworkCallback

* Use OsConstants.ENONET

* Deal with new requirements

* Use main thread for default network callback on API 26+

* Remove unused code

* Fix duplicate authentication

* Update dependencies

* Bump version

* More stupid Android 6 bugs

* Update dependencies

* Downgrade leanback-preference

* Update to API 31

* Remove STORAGE permission on Android 10+

* Update dnsjava

* Ensure that redirects are always followed

Fixes shadowsocks#2786, shadowsocks#2791.

* Update dependencies

* Update to AGP 7.0.2

* Fix lint

* Update dependencies

* Fix shadowsocks#2803

* Remove extra file

* v5.2.6

* Revert "Show full proxied apps mode to compensate for missing title"

This reverts commit d21cf7b.

Fixes shadowsocks#2806.

* Add linkedin.com to gfwlist

* Fix Codacy badge

* Update dependencies

* Update .gitignore

ignore DS_Store

* Just to satisfy the obsessive-compulsive disorder :-)

* Update shadowsocks-rust

Update rust  dependency

* add new ciphers feature, and reorder cipher name

* Modify acl rules

* Update config.yml

try to fix up the rust build error

* enable armv8, neon feathures for hardware acceleration.

* Fix the missing springAnimator

* Update shadowsocks-rust to v1.15.0-alpha.5

* Bump version

* Update translations

Fixes shadowsocks#2867.

* Add German and Ukrainian translations

* Misc fixes

* Fix order

* Use system resolver

* Update dependencies

* Declare POST_NOTIFICATIONS

* Protect sensitive profile information when copied

* Add support for monochrome icons (not recommended)

* Declare supported languages

* Require authentication for closing service

* Support skipping animation in StatsBar

* Downgrade AGP

* Misc fixes

* Turn on fun switch

* Remove useless code

* Bump version

* Fix the compile error shadowsocks#2930 (shadowsocks#2935)

Make checking python version code compatible with windows and *nix

Redefine the python version detection code

Co-authored-by: Mygod <contact-github@mygod.be>
Co-authored-by: Mygod <contact-git@mygod.be>
Co-authored-by: Max Lv <max.c.lv@gmail.com>
Co-authored-by: cyber386 <62885475+cyber386@users.noreply.github.com>
Co-authored-by: Goooler <wangzongler@gmail.com>
Co-authored-by: SquallATF <squallatf@gmail.com>
Co-authored-by: dev4u <dev4u@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants