未找到 SSPI 协商
我使用的是 Windows XP Pro SP3。 我想在我的代码中使用 SSPI 函数。 我编译了我的代码,没有错误。
我设置了用于Negotiate的安全包,这是推荐的。
当我启动程序时,无法使用协商,因为找不到它。 因此,我尝试了“Kerberos”,但出现了同样的错误:找不到安全包。
我查看了注册表,根据该键:HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/Security Packages,可用的安全包有:kerberos、< strong>msv1_0、schannel、wdigest。缺少协商和NTLM。
我不明白为什么我的程序找不到任何安全包。 返回的错误代码是0x80090305,我找不到任何有关修复它的方法的提示。
所以,如果你掌握了SSPI,请我需要你的帮助! 我需要修改注册表中的内容吗? 或者也许我需要注册一些DLL?
感谢您的任何提示 再见!
I'm using Windows XP Pro SP3.
I want to use SSPI functions in my code.
I compiled my code, no error.
I set the security package to be used to Negotiate, which is recommended.
When I start my program, Negotiate cannot be used because it can't be found.
So, I tried "Kerberos" instead, and same error: the security package cannot be found.
I had a look at the registry, and according to that key: HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Lsa/Security Packages, the security packages available are: kerberos, msv1_0, schannel, wdigest. Negotiate and NTLM are missing.
I don't understand why my program can't find any security package.
The returned error code is 0x80090305 and I couldn't find any hint about a way to fix it.
So, if you master the SSPI, please I need your help!
Do I have something to modify in the registry?
Or maybe I need to register some DLLs?
Thanks for any hint
Bye!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SSPI 是一个不用代码调试的牛:)
试试这个代码,看看它是否有效,如果有效,则重试并用 Negotiate 替换 NTLM。实际上,不要使用这个词,“Negotiate”#include“security.h”并使用NEGOSSP_NAME。
另外,尝试一下,看看 Negotiate 是否在列表中:
int main(int argc, _TCHAR* argv[])
{
ULONG cPackages = 0;
PSecPkgInfo pInfo = NULL;
SECURITY_STATUS stat = EnumerateSecurityPackages(&cPackages, &pInfo);
如果(统计== SEC_E_OK){
for (ULONG i = 0; i < cPackages; i++) {
wprintf(L"%s\t%s\n",pInfo[i].Name, pInfo[i].Comment);
}
FreeContextBuffer(pInfo);
}
返回0;
确保
在标头中定义 SECURITY_WIN32,并与 secure32 链接。
SSPI is a cow to debug without code :)
Try this code, see if it works, if it does, re-try it and replace NTLM with Negotiate. Actually, rather than using the word, "Negotiate" #include "security.h" and use NEGOSSP_NAME.
Also, try this, and see if Negotiate is in the list:
int main(int argc, _TCHAR* argv[])
{
ULONG cPackages = 0;
PSecPkgInfo pInfo = NULL;
SECURITY_STATUS stat = EnumerateSecurityPackages(&cPackages, &pInfo);
if (stat == SEC_E_OK) {
for (ULONG i = 0; i < cPackages; i++) {
wprintf(L"%s\t%s\n",pInfo[i].Name, pInfo[i].Comment);
}
FreeContextBuffer(pInfo);
}
return 0;
}
make sure you define SECURITY_WIN32 in your header, and link with secur32.