« Return to Thread: problem with wpa_supplicant on

problem with wpa_supplicant on

by Jeff Sadowski :: Rate this Message:

Reply to Author | View in Thread

wpa_supplicant checks the validity of a server certificate even if it
is not given a cert to verify. I was having issues with my gumstix not
having a time that would make the certificate valid.
Because the gumstix does not have a RTC with a battery to keep the
time. It wouldn't have worked even if my certificate at work was
right. All of the windows machines at my work are set to ignore
certificate validation. There is currently no way to set
wpa_supplicant to ignore the time. Although my Ubuntu distro ignores
it because "wpa_supplicant on Ubuntu was compiled against openssl and
the gumstix wpa_supplicant is using internal TLS implementation in
wpa_supplicant", is what Jouni Malinen  from hostap (the
wpa_supplicant mailing list)
I have been in discussions with the wpa_supplicant developers. Given
some time I think I can create a patch to ignore certificate
validation. In the mean time I created the following script for my
gumstix to auto connect. This script sets the time using the not_after
and not_before times given by wpa_supplicant. The script is not
perfect and I wanted to do as little math in calculating the date as
possible so I used a little off math for the calculations.

#!/bin/sh
#/etc/timecheck.sh
#
twodigit()
{
 if [ $1 -lt 10 ];then
 echo 0$1
 else
 echo $1
 fi
}

#MM=two digit month
#DD=two digit day
#HH=two digit hour in 24 hour
#mm=two digit minute
#YYYY=four digit year
seconds_since_epoch_to_MMDDHHmmYYYY()
{
year=0000
month=0
day=0
hour=0
minute=0

epochyear=1970

#just a close proximity I can be a bit off
#(a number of days) since most certs are
#good for a year period.

let secondsinminute=61
let secondsinhour=60*$secondsinminute
let secondsinday=24*$secondsinhour
let secondsinmonth=30*$secondsinday
let secondsinyear=12*$secondsinmonth

let years=$1/$secondsinyear
let year=$epochyear+$years

let subtractyears=$years*$secondsinyear
let monthsleft=$1-$subtractyears
let months=$monthsleft/$secondsinmonth
let month=$months+1

let subtractmonths=$months*$secondsinmonth
let daysleft=$monthsleft-$subtractmonths
let days=$daysleft/$secondsinday
let day=$days+1

#Since again I don't need to be exact the
#only month that has less than 30 days needs
#checked

if [ $month -eq 2 ];then
if [ $day -gt 28 ];then
day=28
fi
fi

let subtractdays=$days*$secondsinday
let hoursleft=$daysleft-$subtractdays
let hours=$hoursleft/$secondsinhour
let hour=$hours

let subtracthours=$hours*$secondsinhour
let minutesleft=$hoursleft-$subtracthours
let minutes=$minutesleft/$secondsinminute
let minute=$minutes

let subtractminutes=$minutes*$secondsinminute
let secondsleft=$minutesleft-$subtractminutes
if [ $secondsleft -gt 59 ];then
 second=59
else
 second=$secondsleft
fi
echo -n `twodigit $month``twodigit $day`
echo `twodigit $hour``twodigit $minute`$year
}

TMPFILE=/var/volatile/wpastuff

wpa_supplicant -Dmarvell -iwlan0 \
-c/etc/wpa_supplicant.conf \
-w 1>$TMPFILE 2>/dev/null &
#wait for wpa_supplicant to try and connect
sleep 5
killall wpa_supplicant
while [ "`ps|grep wpa_supplicant \
|grep -v grep`" != "" ];do
 sleep 1
done

vars=`cat $TMPFILE |grep now \
|cut -d "(" -f2|cut -d ")" -f1`
if [ "$vars" != "" ];then
 for var in $vars ;do
 let $var
 done
 let diff=$not_after-$not_before
 let halfdiff=$diff/2
 let now=$not_before+$halfdiff
 date `seconds_since_epoch_to_MMDDHHmmYYYY $now`
fi

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gumstix-users mailing list
gumstix-users@...
https://lists.sourceforge.net/lists/listinfo/gumstix-users

 « Return to Thread: problem with wpa_supplicant on