new version(v3) of ppp patch implementing PEAP-MS-CHAP v2



Yesterday our admins updated our RRAS server, and it looks like PEAP protocol slightly changed.

Here is the new patch for PPP 2.4.7 that allows you to connect to MS RRAS via PEAP VPN

First of all some changes should be done on RRAS server, you need to configure the EAP Payload Size and set MTU to 1344. EAP doesn't support fragmentation per RFC but Microsoft implemented EAP fragmentation, however PPP daemon doesn't support it, and will discard packets that are large than MRU MTU negotiated during LCP

technet.microsoft.com/en-us/library/cc755205(v=ws.10).aspx

Patch itself:
https://github.com/rustylife/peap


Also you will need gnutls-dev package

patch modifies default setup location, from /usr/local to /usr so make sure you run a proper pppd

here is some part of config for peer: 
remotename login@domain.com 

 and chap file 
# client server secret IP addresses
login@domain.com * password * 

 if you specify a login in different manner(without @) you'll get a segmentation fault

ppp patch implementing PEAP-MS-CHAP v2

Here is the patch that implements PEAP(type 25) support to ppp linux daemon
Tested with 2008R2 Microsoft RAS server
Applied to 2.4.5 ppp
Thanks to wpa_supplicant(tls impl.) and wireshark creators(tls disect), some part of code was taken from there

patch itself:
https://github.com/rustylife/peap


patch modifies default setup location, from /usr/local to /usr
so make sure you run a proper pppd

here is some part of config for peer:
name login@domain.com
remotename login@domain.com

and chap file
# client        server  secret                  IP addresses
login@domain.com * password *

if you specify a login in different manner(without @) you'll get a segmentation fault, I didn't have much time to implement proper error checking, so it's like a band aid =).



Enjoy!!

Porting compiling lame encoder to Android ARM arch using Android NDK

I was looking for a mp3 encoding application in Android Market, and found very few, the reason I think Android doesn't support mp3 encoding is because mp3 is patented technology. Another reason is I guess people prefer Java programming and Android SDK rather than Android native development kit.

Nevertheless compiling libmp3lame library for Android using Android NDK is very easy actually.

1. download Android NDK(also you need Android SDK and Eclipse with ADT plugin) and create simple project.

2. create directory called "jni" in your project's directory.

3. download lame sources, extract, copy all sources from directory libmp3lame to jni directory. Also copy lame.h which is located in include directory of lame sources.

4. create jni/Android.mk file. it should look like this:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mp3lame
LOCAL_SRC_FILES := bitstream.c fft.c id3tag.c mpglib_interface.c presets.c quantize.c reservoir.c tables.c util.c VbrTag.c encoder.c gain_analysis.c lame.c newmdct.c psymodel.c quantize_pvt.c set_get.c takehiro.c vbrquantize.c version.c
include $(BUILD_SHARED_LIBRARY)

5. clean lame sources, remove what's left from GNU autotools, Makefile.am, Makefile.in, libmp3lame_vc8.vcproj, logoe.ico, depcomp, folders i386, vector.

6. edit file jni/utils.h, and replace definition extern ieee754_float32_t fast_log2(ieee754_float32_t x); with this extern float fast_log2(float x);

7. go to the root directory of your Android project and run $pathtoandroidndk/ndk-build and you're done, you'll have limp3lame.so compiled.