locked
CmAcquireConnection(hConnection) to connect to wifi network returns CMRE_CONNECTION_ACQUIRE_FAILED RRS feed

  • Question

  • Problem Statement :

    I have a use case wherein the user can export the wifi network settings on the windows CE device and import the settings on the another wince device.

    My windows CE7 device is connected to a WPA2 Personal network.The connection Manager API CmGetConnectionConfig returns the profile XML string .This string has the passphrase which is in protected format.

    <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    <name>DDE72C93-ED46-EA78-19A4-214CBDA96616</name>
    <SSIDConfig>
    <SSID>
    <hex>4C414D505F322D344C53</hex>
    <name>LAMP_2-4LS</name>
    </SSID>
    <nonBroadcast>false</nonBroadcast>
    </SSIDConfig>
    <connectionType>ESS</connectionType>
    <connectionMode>manual</connectionMode>
    <MSM>
    <security>
    <authEncryption>
    <authentication>WPA2PSK</authentication>
    <encryption>AES</encryption>
    <useOneX>false</useOneX>
    </authEncryption>
    <sharedKey>
    <keyType>passPhrase</keyType>
    <protected>true</protected>
    <keyMaterial>0100000000000000000000000000000000000000040000200400000000000000000000000100000020000000D2BB36A8BB71418903B7A0E207BE37CDDFDFF8E0000AF3965FBB805CD930A7240000000002800000200000008F9019F370690C546B2E0CBD42EBDBC68589EF737846EE88A3493B0DA837553A10000000ED780FB6F52717DB6BA680043A25418E200000007D4D54054AA6E7A872CC67EA0B28E91D064E659F3AC51FACC13290C1F6069530</keyMaterial>
    </sharedKey>
    </security>
    </MSM>
    </WLANProfile>
    }

    Now if I am using the above WiFi profile xml as is to connect to the personal network in the Device 2  using CmAddConnectionConfig, followed by CmAcquireConnection, the CmAcquireConnection returns the error code CMRE_CONNECTION_ACQUIRE_FAILED. However I noticed that If I attempt to the same network in second device by replacing the protected value to false and the keymaterial with the original passphrase , it works fine. Please let me know how do I resolve this issue . 

    Is it possible that I can decrypt the key material using Cryptographic API's by executing the logic in first device.

    https://msdn.microsoft.com/en-us/library/aa925037.aspx


    Thursday, August 23, 2018 2:26 PM

Answers

  • Found the solution. The keymaterial has to be decrypted using UnProtectKeyMaterial to make it work on the other device.
    • Marked as answer by RachanaSingh Tuesday, September 4, 2018 7:03 AM
    Tuesday, September 4, 2018 7:03 AM