Hello,

I am trying to set WPA key using OID_802_11_xx OIDs.

I set following OIDs in order

OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure

OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK

OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled

OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
(to get 256 bits key from "KT12345678" preshared ASCII key )

OID_802_11_SSID using ssid

But there is something wrong with EAPOL 4-way handshake communication.
AP stays in authentication phase so I can not get IP address from DHCP server.

Do I use wrong key algorithm or my order of OIDs is not correct?

I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?

I do not understand who is responsible for WPA authentication, client software or wireless driver.
If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.


Thanks in advance

Re: Setting WPA key by OID_802_11_xxx by niklaso

niklaso
Tue Aug 03 10:05:10 CDT 2004

(a few days late)

You don't use the output of PBKDF2 with oid_802_11_add_key.

you use the output with the 4-way handshake and then the output of the
4th handshake you use with oid_802_11_add_key.
after you set that oid you will get a group key that you descrypt and
set with the add_key oid. (so the key material is negoiated with the
AP, you don't have it from the beggining as with WEP)

But you will have to create a program that listen for packets so you
can recieve these 4-way handshake and reply to them, everything is
explained in the IEEE 802.11 draft (though now it's no longer a draft
right)

HTH
/Niklas

"AleksaDu" <AleksaDu@discussions.microsoft.com> wrote in message news:<C114DE18-6BB1-48E8-9E54-84B81AB1CC32@microsoft.com>...
> Hello,
>
> I am trying to set WPA key using OID_802_11_xx OIDs.
>
> I set following OIDs in order
>
> OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure
>
> OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK
>
> OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled
>
> OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
> (to get 256 bits key from "KT12345678" preshared ASCII key )
>
> OID_802_11_SSID using ssid
>
> But there is something wrong with EAPOL 4-way handshake communication.
> AP stays in authentication phase so I can not get IP address from DHCP server.
>
> Do I use wrong key algorithm or my order of OIDs is not correct?
>
> I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
> Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?
>
> I do not understand who is responsible for WPA authentication, client software or wireless driver.
> If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.
>
>
> Thanks in advance

Re: Setting WPA key by OID_802_11_xxx by AleksaDu

AleksaDu
Tue Aug 03 15:19:02 CDT 2004

Thanks a lot Niklas for replaying.

After creating intermediate filter driver connected to my wireless network adapter, reading IEEE 802.11i Draft 3.0, IEEE 802.11i Draft 3.0 rev 1.3 from March 2003 and IEEE 802.11-1999 I came (after some time) to the same conclusion.

The first OID_802_11_ADD_KEY is set after 4-way handshake and it carries
Temporal Key (last 256 bits of Pairwise Transient Key), that is actually Pairwise key.

The second OID_802_11_ADD_KEY is set after next 2-way handshake process and it carries a Group Transient Key (256 bits in length), that is actually Global(Multicast) Key.

So from preshared key (in my case "KT12345678") I got a Pairwise Master Key(PMK) by using PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm .

The PMK is later used in 4-way handshake to get Pairwise Transient Key
(512 bits in length) by using PRF-512(PMK,"Pairwise key expansion",Min(AA,SPA)||Max(AA,SPA)||Min(ANonce,SNonce)||Max(ANonce,SNonce)) algorithm.

To do 4-way handshake + 2-way handshake I had to use following crypto algorithms: HMAC-MD5 for EAPOL-Key message integrity end RC4 for
Group Transient Key decryption ( it comes encrypted in the first EAPOL-Key message of 2-way handshake).

To send OID_802_11_XXX OIDs and EAPOL messages (EAPOL-Start and EAPOL -Key messages) as raw data a protocol driver will be good solution.

I hope that these posts will help people to understand how to set WPA key using OID_802_11_XXX OIDs ( at least what is involved in that process).

"Niklas Olsson" wrote:

> (a few days late)
>
> You don't use the output of PBKDF2 with oid_802_11_add_key.
>
> you use the output with the 4-way handshake and then the output of the
> 4th handshake you use with oid_802_11_add_key.
> after you set that oid you will get a group key that you descrypt and
> set with the add_key oid. (so the key material is negoiated with the
> AP, you don't have it from the beggining as with WEP)
>
> But you will have to create a program that listen for packets so you
> can recieve these 4-way handshake and reply to them, everything is
> explained in the IEEE 802.11 draft (though now it's no longer a draft
> right)
>
> HTH
> /Niklas
>
> "AleksaDu" <AleksaDu@discussions.microsoft.com> wrote in message news:<C114DE18-6BB1-48E8-9E54-84B81AB1CC32@microsoft.com>...
> > Hello,
> >
> > I am trying to set WPA key using OID_802_11_xx OIDs.
> >
> > I set following OIDs in order
> >
> > OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure
> >
> > OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK
> >
> > OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled
> >
> > OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
> > (to get 256 bits key from "KT12345678" preshared ASCII key )
> >
> > OID_802_11_SSID using ssid
> >
> > But there is something wrong with EAPOL 4-way handshake communication.
> > AP stays in authentication phase so I can not get IP address from DHCP server.
> >
> > Do I use wrong key algorithm or my order of OIDs is not correct?
> >
> > I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
> > Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?
> >
> > I do not understand who is responsible for WPA authentication, client software or wireless driver.
> > If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.
> >
> >
> > Thanks in advance
>

Re: Setting WPA key by OID_802_11_xxx by NDIS101

NDIS101
Thu Oct 28 19:08:01 CDT 2004

Aleksa,

Have you gotten this to work? Do you have any sample code?

B

"AleksaDu" wrote:

> Thanks a lot Niklas for replaying.
>
> After creating intermediate filter driver connected to my wireless network adapter, reading IEEE 802.11i Draft 3.0, IEEE 802.11i Draft 3.0 rev 1.3 from March 2003 and IEEE 802.11-1999 I came (after some time) to the same conclusion.
>
> The first OID_802_11_ADD_KEY is set after 4-way handshake and it carries
> Temporal Key (last 256 bits of Pairwise Transient Key), that is actually Pairwise key.
>
> The second OID_802_11_ADD_KEY is set after next 2-way handshake process and it carries a Group Transient Key (256 bits in length), that is actually Global(Multicast) Key.
>
> So from preshared key (in my case "KT12345678") I got a Pairwise Master Key(PMK) by using PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm .
>
> The PMK is later used in 4-way handshake to get Pairwise Transient Key
> (512 bits in length) by using PRF-512(PMK,"Pairwise key expansion",Min(AA,SPA)||Max(AA,SPA)||Min(ANonce,SNonce)||Max(ANonce,SNonce)) algorithm.
>
> To do 4-way handshake + 2-way handshake I had to use following crypto algorithms: HMAC-MD5 for EAPOL-Key message integrity end RC4 for
> Group Transient Key decryption ( it comes encrypted in the first EAPOL-Key message of 2-way handshake).
>
> To send OID_802_11_XXX OIDs and EAPOL messages (EAPOL-Start and EAPOL -Key messages) as raw data a protocol driver will be good solution.
>
> I hope that these posts will help people to understand how to set WPA key using OID_802_11_XXX OIDs ( at least what is involved in that process).
>
> "Niklas Olsson" wrote:
>
> > (a few days late)
> >
> > You don't use the output of PBKDF2 with oid_802_11_add_key.
> >
> > you use the output with the 4-way handshake and then the output of the
> > 4th handshake you use with oid_802_11_add_key.
> > after you set that oid you will get a group key that you descrypt and
> > set with the add_key oid. (so the key material is negoiated with the
> > AP, you don't have it from the beggining as with WEP)
> >
> > But you will have to create a program that listen for packets so you
> > can recieve these 4-way handshake and reply to them, everything is
> > explained in the IEEE 802.11 draft (though now it's no longer a draft
> > right)
> >
> > HTH
> > /Niklas
> >
> > "AleksaDu" <AleksaDu@discussions.microsoft.com> wrote in message news:<C114DE18-6BB1-48E8-9E54-84B81AB1CC32@microsoft.com>...
> > > Hello,
> > >
> > > I am trying to set WPA key using OID_802_11_xx OIDs.
> > >
> > > I set following OIDs in order
> > >
> > > OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure
> > >
> > > OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK
> > >
> > > OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled
> > >
> > > OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
> > > (to get 256 bits key from "KT12345678" preshared ASCII key )
> > >
> > > OID_802_11_SSID using ssid
> > >
> > > But there is something wrong with EAPOL 4-way handshake communication.
> > > AP stays in authentication phase so I can not get IP address from DHCP server.
> > >
> > > Do I use wrong key algorithm or my order of OIDs is not correct?
> > >
> > > I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
> > > Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?
> > >
> > > I do not understand who is responsible for WPA authentication, client software or wireless driver.
> > > If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.
> > >
> > >
> > > Thanks in advance
> >

Re: Setting WPA key by OID_802_11_xxx by veeja1972

veeja1972
Thu Oct 28 19:55:02 CDT 2004

AleksaDu-

Do you have any sample code that you can send to me?

thanks,

Scot

"AleksaDu" wrote:

> Thanks a lot Niklas for replaying.
>
> After creating intermediate filter driver connected to my wireless network adapter, reading IEEE 802.11i Draft 3.0, IEEE 802.11i Draft 3.0 rev 1.3 from March 2003 and IEEE 802.11-1999 I came (after some time) to the same conclusion.
>
> The first OID_802_11_ADD_KEY is set after 4-way handshake and it carries
> Temporal Key (last 256 bits of Pairwise Transient Key), that is actually Pairwise key.
>
> The second OID_802_11_ADD_KEY is set after next 2-way handshake process and it carries a Group Transient Key (256 bits in length), that is actually Global(Multicast) Key.
>
> So from preshared key (in my case "KT12345678") I got a Pairwise Master Key(PMK) by using PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm .
>
> The PMK is later used in 4-way handshake to get Pairwise Transient Key
> (512 bits in length) by using PRF-512(PMK,"Pairwise key expansion",Min(AA,SPA)||Max(AA,SPA)||Min(ANonce,SNonce)||Max(ANonce,SNonce)) algorithm.
>
> To do 4-way handshake + 2-way handshake I had to use following crypto algorithms: HMAC-MD5 for EAPOL-Key message integrity end RC4 for
> Group Transient Key decryption ( it comes encrypted in the first EAPOL-Key message of 2-way handshake).
>
> To send OID_802_11_XXX OIDs and EAPOL messages (EAPOL-Start and EAPOL -Key messages) as raw data a protocol driver will be good solution.
>
> I hope that these posts will help people to understand how to set WPA key using OID_802_11_XXX OIDs ( at least what is involved in that process).
>
> "Niklas Olsson" wrote:
>
> > (a few days late)
> >
> > You don't use the output of PBKDF2 with oid_802_11_add_key.
> >
> > you use the output with the 4-way handshake and then the output of the
> > 4th handshake you use with oid_802_11_add_key.
> > after you set that oid you will get a group key that you descrypt and
> > set with the add_key oid. (so the key material is negoiated with the
> > AP, you don't have it from the beggining as with WEP)
> >
> > But you will have to create a program that listen for packets so you
> > can recieve these 4-way handshake and reply to them, everything is
> > explained in the IEEE 802.11 draft (though now it's no longer a draft
> > right)
> >
> > HTH
> > /Niklas
> >
> > "AleksaDu" <AleksaDu@discussions.microsoft.com> wrote in message news:<C114DE18-6BB1-48E8-9E54-84B81AB1CC32@microsoft.com>...
> > > Hello,
> > >
> > > I am trying to set WPA key using OID_802_11_xx OIDs.
> > >
> > > I set following OIDs in order
> > >
> > > OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure
> > >
> > > OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK
> > >
> > > OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled
> > >
> > > OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
> > > (to get 256 bits key from "KT12345678" preshared ASCII key )
> > >
> > > OID_802_11_SSID using ssid
> > >
> > > But there is something wrong with EAPOL 4-way handshake communication.
> > > AP stays in authentication phase so I can not get IP address from DHCP server.
> > >
> > > Do I use wrong key algorithm or my order of OIDs is not correct?
> > >
> > > I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
> > > Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?
> > >
> > > I do not understand who is responsible for WPA authentication, client software or wireless driver.
> > > If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.
> > >
> > >
> > > Thanks in advance
> >

Re: Setting WPA key by OID_802_11_xxx by Pradeep

Pradeep
Fri Jan 04 05:46:03 CST 2008

Hi

Can you share/send the source code

thanks


"AleksaDu" wrote:

> Thanks a lot Niklas for replaying.
>
> After creating intermediate filter driver connected to my wireless network adapter, reading IEEE 802.11i Draft 3.0, IEEE 802.11i Draft 3.0 rev 1.3 from March 2003 and IEEE 802.11-1999 I came (after some time) to the same conclusion.
>
> The first OID_802_11_ADD_KEY is set after 4-way handshake and it carries
> Temporal Key (last 256 bits of Pairwise Transient Key), that is actually Pairwise key.
>
> The second OID_802_11_ADD_KEY is set after next 2-way handshake process and it carries a Group Transient Key (256 bits in length), that is actually Global(Multicast) Key.
>
> So from preshared key (in my case "KT12345678") I got a Pairwise Master Key(PMK) by using PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm .
>
> The PMK is later used in 4-way handshake to get Pairwise Transient Key
> (512 bits in length) by using PRF-512(PMK,"Pairwise key expansion",Min(AA,SPA)||Max(AA,SPA)||Min(ANonce,SNonce)||Max(ANonce,SNonce)) algorithm.
>
> To do 4-way handshake + 2-way handshake I had to use following crypto algorithms: HMAC-MD5 for EAPOL-Key message integrity end RC4 for
> Group Transient Key decryption ( it comes encrypted in the first EAPOL-Key message of 2-way handshake).
>
> To send OID_802_11_XXX OIDs and EAPOL messages (EAPOL-Start and EAPOL -Key messages) as raw data a protocol driver will be good solution.
>
> I hope that these posts will help people to understand how to set WPA key using OID_802_11_XXX OIDs ( at least what is involved in that process).
>
> "Niklas Olsson" wrote:
>
> > (a few days late)
> >
> > You don't use the output of PBKDF2 with oid_802_11_add_key.
> >
> > you use the output with the 4-way handshake and then the output of the
> > 4th handshake you use with oid_802_11_add_key.
> > after you set that oid you will get a group key that you descrypt and
> > set with the add_key oid. (so the key material is negoiated with the
> > AP, you don't have it from the beggining as with WEP)
> >
> > But you will have to create a program that listen for packets so you
> > can recieve these 4-way handshake and reply to them, everything is
> > explained in the IEEE 802.11 draft (though now it's no longer a draft
> > right)
> >
> > HTH
> > /Niklas
> >
> > "AleksaDu" <AleksaDu@discussions.microsoft.com> wrote in message news:<C114DE18-6BB1-48E8-9E54-84B81AB1CC32@microsoft.com>...
> > > Hello,
> > >
> > > I am trying to set WPA key using OID_802_11_xx OIDs.
> > >
> > > I set following OIDs in order
> > >
> > > OID_802_11_INFRASTRUCTURE_MODE to Ndis802_11Infrastructure
> > >
> > > OID_802_11_AUTHENTICATION_MODE to Ndis802_11AuthModeWPAPSK
> > >
> > > OID_802_11_WEP_STATUS to Ndis802_11Encryption2Enabled
> > >
> > > OID_802_11_ADD_KEY using output of PBKDF2("KT12345678",ssid,ssidlength,4096,256) algorithm
> > > (to get 256 bits key from "KT12345678" preshared ASCII key )
> > >
> > > OID_802_11_SSID using ssid
> > >
> > > But there is something wrong with EAPOL 4-way handshake communication.
> > > AP stays in authentication phase so I can not get IP address from DHCP server.
> > >
> > > Do I use wrong key algorithm or my order of OIDs is not correct?
> > >
> > > I saw that people are sending two OID_802_11_ADD_KEY OIDs after OID_802_11_SSID OID and it works.
> > > Could someone tell me at which moment these two OIDs are sent and what is used as WPA key (preshared or output of PBKDF2 algorithm)?
> > >
> > > I do not understand who is responsible for WPA authentication, client software or wireless driver.
> > > If I send WEP key to wireless driver everything is Ok (driver takes key, authentication process is done by driver and I get IP address from AP) but with WPA it is not case.
> > >
> > >
> > > Thanks in advance
> >