GithubHelp home page GithubHelp logo

fwknop2's Introduction

fwknop2 - Android Single Packet Authorization Client

Introduction

This repository contains the Fwknop2 client for using Single Packet Authorization from Android phones. Here are a few screenshots to illustrate Fwknop2 action. We start with the initial startup screen after installation:

![alt text][Fwknop2-startup] [Fwknop2-startup]: /doc/Android_fwknop2_startup.png "Fwknop2 Startup"

Now, add an encryption key and an HMAC key associated with a SPA server named "spaserver":

![alt text][Fwknop2-config] [Fwknop2-config]: /doc/Android_fwknop2_config.png "Fwknop2 Configuration"

Finally, send the SPA packet, and then SSH will be accessiable from the Android phone:

![alt text][Fwknop2-send-SPA-packet] [Fwknop2-send-SPA-packet]: /doc/Android_fwknop2_send_SPA_packet.png "Fwknop2 Send SPA packet"

License

Fwknop2 is released as open source software under the terms of the GNU General Public License v2 or later (GPLv2+). The latest release can be found at https://github.com/oneru/Fwknop2/releases

Contact

All feature requests and bug fixes are managed through github issues tracking.

fwknop2's People

Contributors

jp-bennett avatar micha137 avatar mrash avatar quincunx avatar tofurky avatar tombriden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fwknop2's Issues

Camera fails to capture QR code on Nexus 7

When attempting to scan a QR code from OpenWrt, the Nexus 7 gives a native error message:
"Barcode Scanner: Sorry, the Android camera encountered a problem. You may need to restart the device."

Add connectbot integration

As connectbot is available on the play store and F-droid, it would be good to support calling it via intent. It appears possible to supply host port username and even a nickname in the intent. This will allow for a successful knock to automatically launch a connectbot connection.

Crashes on Nexus 5 with Omnirom at every attempt to knock

The current fdroid version crashes everytime I try to knock a server. This is what logcat reports:

09-04 15:18:51.826  6692  6708 D AutoUpdateManager: network is not available, 0 in queue
09-04 15:18:53.373  8021  8047 V fwknop2 : Your external IP address is myip.opendns.com./80.187.111.118
09-04 15:18:53.373  8021  8047 V libfwknop: **** Init fwknop ****
09-04 15:18:53.373  8021  8047 V libfwknop: Detected key b64
09-04 15:18:53.383  8021  8047 E art     : JNI ERROR (app bug): attempt to use stale global reference 0x2 (should be 0x100002)
09-04 15:18:53.383  8021  8047 F art     : art/runtime/indirect_reference_table.cc:65] JNI ERROR (app bug): see above.
09-04 15:18:53.719  8021  8047 F art     : art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
09-04 15:18:53.719  8021  8047 F art     : art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
09-04 15:18:53.719  8021  8047 F art     : art/runtime/runtime.cc:366] 
09-04 15:18:53.719  8021  8047 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 8047 (AsyncTask #5)
09-04 15:18:53.822  2463  2463 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-04 15:18:53.822  2463  2463 F DEBUG   : Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/MOB30Y/3067468:user/release-keys'
09-04 15:18:53.822  2463  2463 F DEBUG   : Revision: '0'
09-04 15:18:53.822  2463  2463 F DEBUG   : ABI: 'arm'
09-04 15:18:53.822  2463  2463 F DEBUG   : pid: 8021, tid: 8047, name: AsyncTask #5  >>> org.cipherdyne.fwknop2 <<<
09-04 15:18:53.823  2463  2463 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-04 15:18:53.841  2463  2463 F DEBUG   : Abort message: 'art/runtime/indirect_reference_table.cc:65] JNI ERROR (app bug): see above.'
09-04 15:18:53.841  2463  2463 F DEBUG   :     r0 00000000  r1 00001f6f  r2 00000006  r3 9e2f7978
09-04 15:18:53.841  2463  2463 F DEBUG   :     r4 9e2f7980  r5 9e2f7930  r6 00000000  r7 0000010c
09-04 15:18:53.841  2463  2463 F DEBUG   :     r8 b4cbf800  r9 b4cbde44  sl b378bcdb  fp b4ca3468
09-04 15:18:53.841  2463  2463 F DEBUG   :     ip 00000006  sp 9e2f6fd0  lr b6d07bb9  pc b6d09fa8  cpsr 40070010
09-04 15:18:53.865  2463  2463 F DEBUG   : 
09-04 15:18:53.865  2463  2463 F DEBUG   : backtrace:
09-04 15:18:53.865  2463  2463 F DEBUG   :     #00 pc 00041fa8  /system/lib/libc.so (tgkill+12)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #01 pc 0003fbb5  /system/lib/libc.so (pthread_kill+32)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #02 pc 0001c31f  /system/lib/libc.so (raise+10)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #03 pc 000194d1  /system/lib/libc.so (__libc_android_abort+34)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #04 pc 000174bc  /system/lib/libc.so (abort+4)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #05 pc 00333981  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+228)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #06 pc 000f460b  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #07 pc 000f08e1  /system/lib/libart.so (_ZN3art7BarrierD2Ev+216)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #08 pc 0035b483  /system/lib/libart.so (_ZN3art10ThreadList4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+162)
09-04 15:18:53.866  2463  2463 F DEBUG   :     #09 pc 00333a45  /system/lib/libart.so (_ZN3art7Runtime5AbortEv+424)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #10 pc 000f460b  /system/lib/libart.so (_ZN3art10LogMessageD2Ev+2226)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #11 pc 001de275  /system/lib/libart.so (_ZN3art22IndirectReferenceTable17AbortIfNoCheckJNIEv+64)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #12 pc 0025925b  /system/lib/libart.so (_ZN3art9JavaVMExt12DecodeGlobalEPNS_6ThreadEPv+506)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #13 pc 0035102b  /system/lib/libart.so (_ZNK3art6Thread13DecodeJObjectEP8_jobject+174)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #14 pc 000e5779  /system/lib/libart.so (_ZN3art25JniMethodEndWithReferenceEP8_jobjectjPNS_6ThreadE+76)
09-04 15:18:53.867  2463  2463 F DEBUG   :     #15 pc 00764f6b  /data/app/org.cipherdyne.fwknop2-1/oat/arm/base.odex (offset 0x505000)
09-04 15:18:54.281  2463  2463 F DEBUG   : 
09-04 15:18:54.281  2463  2463 F DEBUG   : Tombstone written to: /data/tombstones/tombstone_05
09-04 15:18:54.281  2463  2463 E DEBUG   : AM write failed: Broken pipe
09-04 15:18:54.282 12328 12544 I BootReceiver: Copying /data/tombstones/tombstone_05 to DropBox (SYSTEM_TOMBSTONE)
09-04 15:18:54.285 12328  8099 W ActivityManager:   Force finishing activity org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity
09-04 15:18:54.335 12328 13393 W InputDispatcher: channel 'c5b9899 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-04 15:18:54.335 12328 13393 E InputDispatcher: channel 'c5b9899 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-04 15:18:54.335 12328 13393 W InputDispatcher: channel '7a34f37 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
09-04 15:18:54.335 12328 13393 E InputDispatcher: channel '7a34f37 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
09-04 15:18:54.351 12328 17801 I WindowState: WIN DEATH: Window{c5b9899 u0 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity}
09-04 15:18:54.351 12328 17801 W InputDispatcher: Attempted to unregister already unregistered input channel 'c5b9899 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)'
09-04 15:18:54.352 12328 14752 D GraphicsStats: Buffer count: 16
09-04 15:18:54.354 12328  9557 I WindowState: WIN DEATH: Window{7a34f37 u0 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity}
09-04 15:18:54.354 12328  9557 W InputDispatcher: Attempted to unregister already unregistered input channel '7a34f37 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (server)'
09-04 15:18:54.390 11758 11758 I Zygote  : Process 8021 exited due to signal (6)
09-04 15:18:54.398 12328  8099 W ActivityManager: Exception thrown during pause
09-04 15:18:54.398 12328  8099 W ActivityManager: android.os.DeadObjectException
09-04 15:18:54.398 12328  8099 W ActivityManager:   at android.os.BinderProxy.transactNative(Native Method)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at android.os.BinderProxy.transact(Binder.java:503)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:727)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:868)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:2911)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityStack.finishTopRunningActivityLocked(ActivityStack.java:2767)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityStackSupervisor.finishTopRunningActivityLocked(ActivityStackSupervisor.java:2760)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:12063)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:11959)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:12648)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:12155)
09-04 15:18:54.398 12328  8099 W ActivityManager:   at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
09-04 15:18:54.401   182   182 E lowmemorykiller: Error opening /proc/8021/oom_score_adj; errno=2
09-04 15:18:54.426 12328  6831 I ActivityManager: Process org.cipherdyne.fwknop2 (pid 8021) has died
09-04 15:18:54.481 12328 14495 I OpenGLRenderer: Initialized EGL, version 1.4
09-04 15:18:54.484 12328 12343 I art     : Background partial concurrent mark sweep GC freed 38562(2MB) AllocSpace objects, 18(1432KB) LOS objects, 30% free, 36MB/52MB, paused 10.549ms total 159.385ms
09-04 15:18:54.548 23427  8102 D DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
09-04 15:18:54.585 23427  8102 D DropBoxEntryAddedChimeraService: User is not opted-in to Usage & Diagnostics or Lockbox.
09-04 15:18:54.857  6692  6708 D AutoUpdateManager: network is not available, 0 in queue
09-04 15:18:54.990 12328 12547 W WindowAnimator: Failed to dispatch window animation state change.
09-04 15:18:54.990 12328 12547 W WindowAnimator: android.os.DeadObjectException
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.BinderProxy.transactNative(Native Method)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.BinderProxy.transact(Binder.java:503)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.view.Choreographer.doCallbacks(Choreographer.java:670)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.view.Choreographer.doFrame(Choreographer.java:603)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.Handler.handleCallback(Handler.java:739)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.Handler.dispatchMessage(Handler.java:95)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.Looper.loop(Looper.java:148)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at android.os.HandlerThread.run(HandlerThread.java:61)
09-04 15:18:54.990 12328 12547 W WindowAnimator:    at com.android.server.ServiceThread.run(ServiceThread.java:46)
09-04 15:18:54.991 12328 12547 W WindowAnimator: Failed to dispatch window animation state change.
09-04 15:18:54.991 12328 12547 W WindowAnimator: android.os.DeadObjectException
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.BinderProxy.transactNative(Native Method)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.BinderProxy.transact(Binder.java:503)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.view.IWindow$Stub$Proxy.onAnimationStopped(IWindow.java:534)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.updateWindowsLocked(WindowAnimator.java:286)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.animateLocked(WindowAnimator.java:678)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator.-wrap0(WindowAnimator.java)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at com.android.server.wm.WindowAnimator$1.doFrame(WindowAnimator.java:123)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:856)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.view.Choreographer.doCallbacks(Choreographer.java:670)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.view.Choreographer.doFrame(Choreographer.java:603)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.Handler.handleCallback(Handler.java:739)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.Handler.dispatchMessage(Handler.java:95)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.Looper.loop(Looper.java:148)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at android.os.HandlerThread.run(HandlerThread.java:61)
09-04 15:18:54.991 12328 12547 W WindowAnimator:    at com.android.server.ServiceThread.run(ServiceThread.java:46)

OpenWRT fwknockd does not register knock, app says OK

I'm trying to open port 8000 and port forward the connection to an Icecast HTTP server on the LAN behind the OpenWRT router. The Android app says OK when I knock but the OpenWRT fwknockd logs nothing. I've tried with and without GPG.

OpenWrt 18.06.2 Linux apu 4.14.95 #0 SMP Mon Jan 28 08:54:32 2019 x86_64 GNU/Linux
fwknopd server version 2.6.9
luci-app-fwknopd version git-19.051.55698-76cf653-1
Android 7.0 kernel-3.10.84
Cipherdyne fwknop2 - Last updated Oct 2017

fwknop1
fwknop2

OpenWRT conf -

root@openwrt:~# cat /var/etc/access.conf 
SOURCE ANY
keytype Base 64 key
hkeytype Base 64 key
snipped=
HMAC_KEY_BASE64 snipped==
FW_ACCESS_TIMEOUT 30

root@openwrt:~# cat /etc/fwknop/access.conf 
GPG_REMOTE_ID         <snipped>
SOURCE              ANY
KEY_BASE64          snipped=
HMAC_KEY_BASE64     snipped==
SOURCE: ANY;
DATA_COLLECT_MODE: PCAP;
GPG_REMOTE_ID: snipped;
GPG_DECRYPT_ID: snipped
GPG_HOME_DIR: /root/.gnupg;
FW_ACCESS_TIMEOUT: 60;

OpenWRT log does not register the knock -

Thu Mar 14 19:03:46 2019 daemon.err fwknopd[13030]: [*] Ignoring unknown access parameter: 'keytype' in /var/etc/access.conf
Thu Mar 14 19:03:46 2019 daemon.err fwknopd[13030]: [*] Ignoring unknown access parameter: 'hkeytype' in /var/etc/access.conf
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Warning: REQUIRE_SOURCE_ADDRESS not enabled for access stanza source: 'ANY'
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Starting fwknopd
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Added jump rule from chain: INPUT to chain: FWKNOP_INPUT
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Added jump rule from chain: FORWARD to chain: FWKNOP_FORWARD
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Added jump rule from chain: PREROUTING to chain: FWKNOP_PREROUTING
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: iptables 'comment' match is available
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Sniffing interface: eth0
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: PCAP filter is: 'udp port 62201'
Thu Mar 14 19:03:46 2019 daemon.info fwknopd[13030]: Starting fwknopd main event loop.

What am I missing here?

app sends knocks over ipv6

Fwknop has no ipv6 support as of yet, but the app will gladly resolve a domain name as an IPv6 address and send packets there.

QR capture not working

Hello, I am following up an issue first mentioned on google Play which I'd be glad to adjust.
I met an issue with the qr capture function on both a Samsung 7 and a AT&T tablet.
I ended up copying/pasting the keys sent by email and once entered into Fwknop2 configuration screen it worked so the issue is really around the qr capture function:
First after the installation FWKNOPW2 would freeze completely forcing to close the app. After a reboot, qr capture still doesn't work but get back to the main screen but the fields remains blank.
I have 3 tried 3 sets of keys fwknop --key-gen from a Centos 7 instance and none of them worked. Here is the first set that I don't use if it can help to resolve the issue :.
KEY_BASE64: qy+ME3gX1bSwPGD3FrH2cI5s1+sbQZUD1h2B9jW+Riw=
HMAC_KEY_BASE64: 9ah6kkve3yPV/egCuf5Cp8HlU0anBoxn8/z8MqWBMkBKwb4Pb/ude928gjQBIvRn4GEvycMqtzDIveaf44kT5w==
Thank-you,
Bernard

`delete config` button too close to `send knock`

.. especially on a small phone
It's not a bug ,its a wonderful app! Just one thing to consider for future. It's great to have the ability to delete a config but I believe deleting a config to be needed once in while and not as often as send a knock.

GPG Hardware Token not working

I've been playing with my yubikey 4 which works perfectly with openKeychain. If send a knock it gives me "Success" but there is never a Packet send.

I'm using UDP server mode. If I create a GPG key on the device I'm able to send a knock.

Add support for username

A request has been made to support sending a username from the Android client. Traxking with this bug.

crash with no ssh app

apparently Android throws an exception if there is no app to handle an ssh uri. Catch and possibly redirect to app store.

allow any uri instead of just ssh

While opening an SSH connection is useful, it might be even more useful to allow any uri to be called after sending a knock. This would enable launching any app that has uri support.

Sending knocks in response to intents from other apps

Need to add intent handling and some sort of restriction system, so intents aren't just blindly accepted. A simple solution would be to just mark each knock as allowing or not allowing remote trigger. Potentially also store what apps are allowed to start Fwknop2 via intents, and prompt the user when a new app attempts to initiate.

Add mechanism to copy configurations

I have a few applications / ports that need setup to a single machine and want to setup multiple hosts, however the current implementation requires I either setup a QR code to partly fill details in, or manually fill it all in multiple times.

A long-press => duplicate option would save quite a bit of time.

Prompt for key on knock

If user doesn't want the app to store the key, he should be able to leave the key field blank, and the app should prompt for the key when sending the knock.

Problems with M

Android M introduces some new permission controls, which breaks multiple elements.

GPG support

If possible, we should add GPG support to the android client

New config

New config leaves an existing config highlighted and leaves the send knock button in place.

Add icon

Need to find an icon for fwknop2. A door knocker would be perfect

Can't set IP resolver URL if it contains a path

  1. Tap the 3 dots in the main menu and go to Configure.
  2. Enter a URL containing a path (eg. https://example.com/ip).
  3. Click Save Settings.

You'll get an error "URL must be in the form of http://whatismyip.akamai.com or https://api.ipify.org".

There are two issues here:

  1. The error message text is incorrect. Fwknop2 does support custom URLs. I suggest changing the text to be something like "Please enter a valid URL".
  2. Validation fails if the URL contains a path component.

Here's the relevant code:

if (DomainValidator.getInstance().isValid(tmp[1])) {

The string being passed to the DomainValidator is just everything to the right of ://. It likely needs to be split again on / so it only gives the hostname to the DomainValidator. Actually, it should also check for a custom port by splitting on a colon if it exists. Come to think of it, perhaps this DomainValidator should be dropped in favour of a general URL validation library.

Countdown timer and auto reknock

Want to add an option to show a countdown timer on sending a successful knock. Shouldn't be shown if another application is automatically launched.

With this, want an option to automatically send another SPA packet when the timer nears 0, intended for connections that don't cope well with the iptables ACCEPT rule being removed. Ideally fwknop issue #158 will be dealt with by this time. The ideal case would be when finished with the connection, the app would send a replacement rule with a very short timeout, to serve as a close message.

Check for base64 validity

When checking the either of the "is base64" boxes, it would be handy if a verification step would make sure the supplied data only contains characters allowed within the base64 encoding character set, and also that the trailing '=' padding chars match the multiple of four requirement.

If any spaces in Access Ports, crash-on-knock

I was trying to open up multiple access ports and did not know the correct syntax, so I put in:

tcp/22 tcp/2022

Or (assuming a comma is needed)
tcp/22, tcp/2022

When attempting to knock with this, the application crashes.

It appears the correct format is comma-delimited with no spaces:

tcp/22,tcp/2022

There should be some sort of check in the configuration page to warn on bad input.

Publish Betas to FDroid

It would be useful if you published betas to FDroid so that users have the option of getting the latest-and-greatest without switching to the Google version.

Legacy mode

Should add the option to send knock in legacy mode, if feasible.

Crash on null

The program logic assumes that the database will never contain a null. In the event that a null is returned as part of a config, the app will likely crash. Should add logic in getConfig() that checks for nulls and replaces with a blank string.

Add a test suite

Would be really good for QA to have a test suite for the android app.

Send Knock error: "Failure generating SPA data" when multiple ports specified

I keep getting this error "Failure generating SPA data", despite having what appears to be a valid config with multiple ports. It would be really nice to have a log file to look at. One port seems to work. I've tried multiple delimeters, though I think the correct syntax is "udp/500, udp/4500" (ie: comma delimeter). I tried looking at the code but I'm not a programmer so I got lost following what happens to access_str in SendSPA.java (This is where the error is).

--nat-local support

Please could you add support for --nat-local.

It's similar to the existing "NAT Access" option you have under "Message Type" except the nat rules fwknopd create redirect traffic to the system fwknopd is on, so it doesn't require a separate ip address to be specified.

Many thanks.

malformed QR code crashes the app / QR code text trimming

Two problems discovered:

  • Certain QR code would crash the app
  • QR code text is imported as is, no trimming/verification is done until user hits save

In attempt to generate my own QR code, I ran the following command.

 fwknop --key-gen | qrencode -t UTF8

The above generated QR code would crash the app.

Afterwards, I tried edit the ouptut of fwknop --key-gen to conform to that of OpenWrt package (KEY_BASE64:{CODE} HMAC_KEY_BASE64:{CODE}). In the process also learned that the app doesn't attempt to trim the text from QR code.

This resulted in the save operation telling me the Base64 is invalid. It took me awhile to figure out that it was merely due to the fact that there is a space at the end of the Base64 code.

Feature Request: OpenVPN

Knocking, then opening JuiceSSH is nice,.... but knocking, then opening up OpenVPN is also very nice.

I don't SSH from the outside, but I would if I am VPN'ing first.

Application crash with gpg enabled

Tested with version 1.30am installed along side openkeychain 4.2.4. I imported my 2048bit server pub key and 2048bit secret key. I am able select the signing key but Abbeville selecting the encryption key the app hangs after selecting the key. Below is a logcat I grabbed.

04-24 18:15:23.424  4111  4111 V fwknop2 : juicessh not installed
04-24 18:15:23.427  4111  4111 V fwknop2 : Openkeychain installed
04-24 18:15:23.536   580   580 D SFPerfTracer:        layers: (3:9) (StatusBar (0xb1a49800): 8:88532) (com.android.systemui.ImageWallpaper (0xb1a64400): 8:44287)* (DimLayerController/Stack=0 (0xb1a45c00): 0:1593)* (animation background stackId=1 (0xb1a63000): 0:257)* (Sprite (0xb1a47000): 0:279)* (com.teslacoilsw.launcher/com.teslacoilsw.launcher.NovaLauncher (0xb1a4ac00): 0:34)- (Starting org.cipherdyne.fwknop2 (0xb1a48400): 0:15)- (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (0xb1a65800): 8:94) (PopupWindow:8ad281e (0xb1a48400): 12:24) 
04-24 18:15:23.587  1566  1632 I LaunchCheckinHandler: Displayed org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity,wp,ca,188
04-24 18:15:23.588  1566  1632 I ActivityManager: Displayed org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity: +188ms
04-24 18:15:23.787  1566 13067 I WindowManager: Destroying surface Surface(name=org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.destroyOrSaveSurface:2094 com.android.server.wm.WindowManagerService.tryStartExitingAnimation:3093 com.android.server.wm.WindowManagerService.relayoutWindow:2973 com.android.server.wm.Session.relayout:215 android.view.IWindowSession$Stub.onTransact:286 com.android.server.wm.Session.onTransact:136 
04-24 18:15:25.394  4111  4111 D fwknop2 : Result OK
04-24 18:15:29.897  4111  4111 D fwknop2 : in callback onreturn
04-24 18:15:29.898  4111  4111 D fwknop2 : interaction
04-24 18:15:29.900  1566  2611 I ActivityManager: START u0 {dat=content://org.sufficientlysecure.keychain.provider/api_apps/org.cipherdyne.fwknop2 cmp=org.sufficientlysecure.keychain/.remote.ui.SelectSignKeyIdActivity (has extras)} from uid 10222 on display 0
04-24 18:15:30.272   580   580 D SFPerfTracer:        layers: (2:12) (StatusBar (0xb1a49800): 5:88572) (com.android.systemui.ImageWallpaper (0xb1a64400): 5:44325)* (DimLayerController/Stack=0 (0xb1a45c00): 0:1593)* (animation background stackId=1 (0xb1a63000): 1:261)* (Sprite (0xb1a47000): 0:279)* (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity (0xb1a65800): 0:110)- (PopupWindow:8ad281e (0xb1a48400): 0:26)- (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity (0xb1a4ac00): 5:89)* (InputMethod (0xb1a66c00): 0:23)- (NavigationBar (0xb1a48400): 0:22)- (SurfaceView - InputMethod (0xb1d95000): 0:22)- (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.SelectSignKeyIdActivity (0xb1a65800): 5:14)
04-24 18:15:30.590  1566  2068 I WindowManager: Destroying surface Surface(name=org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.destroyOrSaveSurface:2094 com.android.server.wm.WindowManagerService.tryStartExitingAnimation:3093 com.android.server.wm.WindowManagerService.relayoutWindow:2973 com.android.server.wm.Session.relayout:215 android.view.IWindowSession$Stub.onTransact:286 com.android.server.wm.Session.onTransact:136
04-24 18:15:31.376  4111  4111 D fwknop2 : ConfigDetailActivity onActivityResult
04-24 18:15:31.377  4111  4111 D fwknop2 : Result: -1
04-24 18:15:33.735  4111  4111 D fwknop2 : in callback onreturn
04-24 18:15:33.735  4111  4111 D fwknop2 : interaction
04-24 18:15:33.739  1566  2611 I ActivityManager: START u0 {dat=content://org.sufficientlysecure.keychain.provider/api_apps/org.cipherdyne.fwknop2 cmp=org.sufficientlysecure.keychain/.remote.ui.SelectSignKeyIdActivity (has extras)} from uid 10222 on display 0
04-24 18:15:34.417  1566  1805 I WindowManager: Destroying surface Surface(name=org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.destroyOrSaveSurface:2094 com.android.server.wm.WindowManagerService.tryStartExitingAnimation:3093 com.android.server.wm.WindowManagerService.relayoutWindow:2973 com.android.server.wm.Session.relayout:215 android.view.IWindowSession$Stub.onTransact:286 com.android.server.wm.Session.onTransact:136
04-24 18:15:34.436   580   580 D SFPerfTracer:        layers: (2:9) (StatusBar (0xb1a49800): 3:88617) (com.android.systemui.ImageWallpaper (0xb1a64400): 3:44370)* (DimLayerController/Stack=0 (0xb1a45c00): 0:1593)* (animation background stackId=1 (0xb1a63000): 0:263)* (Sprite (0xb1a47000): 0:279)* (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity (0xb1a4ac00): 0:92)- (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.SelectSignKeyIdActivity (0xb1a65800): 0:52)- (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity (0xb1a4ac00): 3:62)* (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.SelectSignKeyIdActivity (0xb1a65800): 21:35)
04-24 18:15:35.891  4111  4111 D fwknop2 : ConfigDetailActivity onActivityResult
04-24 18:15:35.891  4111  4111 D fwknop2 : Result: -1
04-24 18:15:39.747  4111  4111 D fwknop2 : in callback onreturn
04-24 18:15:39.747  4111  4111 D fwknop2 : interaction
04-24 18:15:40.017   580   580 D SFPerfTracer:        layers: (4:8) (StatusBar (0xb1a49800): 6:88649) (com.android.systemui.ImageWallpaper (0xb1a64400): 6:44402)* (DimLayerController/Stack=0 (0xb1a45c00): 0:1593)* (animation background stackId=1 (0xb1a63000): 1:264) (Sprite (0xb1a47000): 0:279)* (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.SelectSignKeyIdActivity (0xb1a65800): 0:53)- (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity (0xb1a4ac00): 6:85) (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.RemoteSelectPubKeyActivity (0xb1a65800): 6:9)
04-24 18:15:40.434  1566 13067 I WindowManager: Destroying surface Surface(name=org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity) called by com.android.server.wm.WindowStateAnimator.destroySurface:2067 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:896 com.android.server.wm.WindowState.destroyOrSaveSurface:2094 com.android.server.wm.WindowManagerService.tryStartExitingAnimation:3093 com.android.server.wm.WindowManagerService.relayoutWindow:2973 com.android.server.wm.Session.relayout:215 android.view.IWindowSession$Stub.onTransact:286 com.android.server.wm.Session.onTransact:136
04-24 18:15:41.692  4111  4111 D fwknop2 : ConfigDetailActivity onActivityResult
04-24 18:15:41.692  4111  4111 D fwknop2 : Result: -1
04-24 18:15:41.692  4111  4111 D fwknop2 : Trying to set crypt
04-24 18:15:41.693  4111  4111 E fwknop2 : main: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9916, result=-1, data=Intent { act=org.openintents.openpgp.action.GET_KEY_IDS (has extras) }} to activity {org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity}: java.lang.NullPointerException: Attempt to read from null array
04-24 18:15:46.703   580   580 D SFPerfTracer:        layers: (2:7) (StatusBar (0xb1a49800): 300:88959) (com.android.systemui.ImageWallpaper (0xb1a64400): 300:44712)* (DimLayerController/Stack=0 (0xb1a45c00): 0:1593)* (animation background stackId=1 (0xb1a63000): 0:265)* (Sprite (0xb1a47000): 0:279)* (org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity (0xb1a4ac00): 0:93)- (org.sufficientlysecure.keychain/org.sufficientlysecure.keychain.remote.ui.RemoteSelectPubKeyActivity (0xb1a65800): 300:349)
04-24 18:16:59.032  1566 32279 I ActivityManager: Killing 4111:org.cipherdyne.fwknop2/u0a135 (adj 200): remove task
04-24 18:16:59.046  1566 28012 I WindowManager: WIN DEATH: Window{1742242 u0 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigDetailActivity}
04-24 18:16:59.048  1566 26172 I WindowManager: WIN DEATH: Window{2727092 u0 org.cipherdyne.fwknop2/biz.incomsystems.fwknop2.ConfigListActivity}

Key_len

Key_len is not being set for a non base 64 string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.