简体   繁体   English

有没有一种方法可以使用XML Provisioning在Windows CE或Mobile上查询存储的Wi-fi网络密钥?

[英]Is there a way to query stored Wi-fi network keys on Windows CE or Mobile using XML Provisioning?

I'm wondering if anyone has experience getting a stored Wi-fi network key from a WinCE device. 我想知道是否有人有从WinCE设备获取存储的Wi-fi网络密钥的经验。 I can configure our Windows CE (Embedded Compact 7) device to connect to a Wifi network and can specify the AP name, security mode, network key, etc. by using the built-in XML Provisioning . 我可以将Windows CE(嵌入式Compact 7)设备配置为连接到Wifi网络,并可以使用内置的XML Provisioning指定AP名称,安全模式,网络密钥等。 I can also read out all Wifi settings for the device using this method (also XML Provisioning). 我还可以使用此方法 (也包括XML Provisioning)读出设备的所有Wifi设置。 However, all the settings are returned except for the network key. 但是,将返回除网络密钥以外的所有设置。 I suspect this is for security purposes. 我怀疑这是出于安全目的。

Is there a way to force it to reveal the network key, or perhaps some other way to programmatically access this stored data? 有没有一种方法可以强迫它显示网络密钥,或者以其他方式以编程方式访问此存储的数据?

Many thanks! 非常感谢!

Edit: 编辑:

@Nicolas-R requested an example. @ Nicolas-R请求一个示例。

Here's setting the Wi-Fi settings on the device using XML provisioning (for WPA2-Personal authentication): 这是使用XML设置(用于WPA2-个人身份验证)在设备上设置Wi-Fi设置的:

<wap-provisioningdoc>
    <characteristic type="Wi-Fi">
        <characteristic type="access-point">
            <characteristic type="MyWirelessApName">
                <parm name="Hidden" value="0" />
                <parm name="Encryption" value="6" />
                <parm name="Authentication" value="7" />
                <parm name="KeyIndex" value="1" />
                <parm name="NetworkKey" value="MyNetworkPassword" />
                <parm name="KeyProvided" value="0" />
                <parm name="Use8021x" value="0" />
                <parm name="EAPType" value="0" />
            </characteristic>
        </characteristic>
    </characteristic>
</wap-provisioningdoc>

And here is how to query all Wi-Fi info from the device: 以下是从设备查询所有Wi-Fi信息的方法:

<wap-provisioningdoc>
    <characteristic type="Wi-Fi">
        <characteristic-query type="access-point" recursive="true"/>
    </characteristic>
</wap-provisioningdoc>

Here's the response I get back from the device: 这是我从设备返回的响应:

<wap-provisioningdoc>
    <characteristic type="Wi-Fi">
        <characteristic type="access-point" recursive="true">
            <characteristic type="MyWirelessApName"><parm name="DestId" value="{436EF144-B8FB-4863-A041-8F945A62C572}"/>
                <parm name="AdHoc" value="0"/>
                <parm name="Hidden" value="0"/>
                <parm name="Authentication" value="7"/>
                <parm name="Encryption" value="6"/>
                <parm name="KeyProvided" value="0"/>
                <parm name="NetworkKey" value=""/>
                <parm name="KeyIndex" value="1"/>
                <parm name="Use8021x" value="0"/>
                <parm name="EAPType" value="0"/>
            </characteristic>
        </characteristic>
    </characteristic>
</wap-provisioningdoc>

As you can see, the NetworkKey returned is blank. 如您所见,返回的NetworkKey为空白。 I've tested this, however, to verify that the REAL network key really is stored on the WinCE device (and it is; it successfully joins the password-protected access point). 但是,我已经对此进行了测试,以验证REAL网络密钥是否确实存储在WinCE设备上(确实如此;它成功加入了受密码保护的访问点)。

I used to manipulate XML Provisioning for setting devices' APN, and a "problem" was also occurring with APN's password: we can only get '*' chars for security reasons according to the documentation: http://msdn.microsoft.com/en-us/library/bb737338.aspx 我曾经使用XML Provisioning来设置设备的APN,并且APN的密码也出现了“问题”:根据文档,出于安全原因,我们只能获取'*'字符: http : //msdn.microsoft.com/ EN-US /库/ bb737338.aspx

Queries of the Password field will return a string composed of asterisks ('*'). 查询“密码”字段将返回由星号('*')组成的字符串。

The behaviour you depict is not compliant with the Wifi provisioning documentation ( http://msdn.microsoft.com/en-us/library/bb737539.aspx ): 您描述的行为不符合Wifi设置文档( http://msdn.microsoft.com/en-us/library/bb737539.aspx ):

NetworkKey 网络密钥

Specifies the network key in ASCII or hexadecimal. 以ASCII或十六进制指定网络密钥。 You can set or query the value. 您可以设置或查询值。 The maximum length of this value is 64 characters. 此值的最大长度为64个字符。

Note: This parm is stored and sent as plain text. 注意:此参数是作为纯文本存储和发送的。 You should make sure you transmit XML that contains this setting in a secure manner since access to the XML provides access to the network key. 您应该确保以安全的方式传输包含此设置的XML,因为对XML的访问提供了对网络密钥的访问。

Can you provide a sample code of your tests for the provisioning query? 您可以为配置查询提供测试的示例代码吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM