#ifdef AFS_NT40_ENV
#include <winsock2.h>
#include <WINNT/afsevent.h>
+#include <WINNT/afsreg.h>
#else
#include <netinet/in.h>
#endif
return 0;
}
+#ifdef AFS_NT40_ENV
+static DWORD
+win32_enableCrypt(void)
+{
+ HKEY parmKey;
+ DWORD dummyLen;
+ DWORD cryptall = 0;
+ DWORD code;
+
+ /* Look up configuration parameters in Registry */
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
+ 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
+ if (code != ERROR_SUCCESS) {
+ dummyLen = sizeof(cryptall);
+ RegQueryValueEx(parmKey, "SecurityLevel", NULL, NULL,
+ (BYTE *) &cryptall, &dummyLen);
+ }
+ RegCloseKey (parmKey);
+
+ return cryptall;
+}
+#endif /* AFS_NT40_ENV */
+
static int
GetGlobals(struct cmd_syndesc *as, void *arock)
{
changed = 1;
sec = 1;
}
- if (as->parms[22].items) { /* -encrypt */
+ if (as->parms[22].items /* -encrypt */
+#ifdef AFS_NT40_ENV
+ || win32_enableCrypt()
+#endif /* AFS_NT40_ENV */
+ ) {
changed = 1;
sec = 3;
}
#include <fcntl.h>
#include <io.h>
#include <winsock2.h>
+#include <WINNT/afsreg.h>
#else
#include <sys/time.h>
#include <sys/file.h>
}
+#ifdef AFS_NT40_ENV
+static DWORD
+win32_enableCrypt(void)
+{
+ HKEY parmKey;
+ DWORD dummyLen;
+ DWORD cryptall = 0;
+ DWORD code;
+
+ /* Look up configuration parameters in Registry */
+ code = RegOpenKeyEx(HKEY_LOCAL_MACHINE, AFSREG_CLT_SVC_PARAM_SUBKEY,
+ 0, (IsWow64()?KEY_WOW64_64KEY:0)|KEY_QUERY_VALUE, &parmKey);
+ if (code != ERROR_SUCCESS) {
+ dummyLen = sizeof(cryptall);
+ RegQueryValueEx(parmKey, "SecurityLevel", NULL, NULL,
+ (BYTE *) &cryptall, &dummyLen);
+ }
+ RegCloseKey (parmKey);
+
+ return cryptall;
+}
+#endif /* AFS_NT40_ENV */
+
static int
MyBeforeProc(struct cmd_syndesc *as, void *arock)
{
tcell = as->parms[12].items->data;
if (as->parms[14].items) /* -serverauth specified */
sauth = 1;
- if (as->parms[16].items) /* -crypt specified */
+ if (as->parms[16].items /* -encrypt specified */
+#ifdef AFS_NT40_ENV
+ || win32_enableCrypt()
+#endif /* AFS_NT40_ENV */
+ )
vsu_SetCrypt(1);
if ((code =
vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth,