-
Notifications
You must be signed in to change notification settings - Fork 0
/
frmOverride.frm
161 lines (150 loc) · 5.14 KB
/
frmOverride.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
VERSION 5.00
Begin VB.Form frmOverride
BorderStyle = 1 'Fixed Single
Caption = "Override settings"
ClientHeight = 2505
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
KeyPreview = -1 'True
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2505
ScaleWidth = 4680
StartUpPosition = 1 'CenterOwner
Begin VB.CommandButton cmdOkay
Caption = "&OK"
Height = 375
Left = 3240
TabIndex = 6
Top = 2040
Width = 1335
End
Begin VB.Frame fmeOverride
Caption = "Override:"
Height = 1815
Left = 120
TabIndex = 7
Top = 120
Width = 4455
Begin VB.CheckBox chkDropPIM
Caption = "Drop default PIM to 92 (sha512/Whirlpool usage only)"
Height = 315
Left = 120
TabIndex = 5
ToolTipText = "Note: For VeraCrypt with sha512/Whirlpool usage only"
Top = 1440
Width = 4215
End
Begin VB.CheckBox chkLimitPIM
Caption = "Limit PIM usage to passwords that are 64 characters"
Height = 315
Left = 120
TabIndex = 4
Top = 1200
Width = 4215
End
Begin VB.CheckBox chkRandom
Caption = "Make generation slightly more random"
Height = 315
Left = 120
TabIndex = 3
ToolTipText = "Note: This could be a good thing or bad thing depending on randomness"
Top = 960
Width = 4215
End
Begin VB.CheckBox chk512
Caption = "Allow passwords up to 512 character(s)"
Height = 315
Left = 120
TabIndex = 2
Top = 720
Width = 4215
End
Begin VB.CheckBox chk256
Caption = "Allow passwords up to 256 character(s)"
Height = 315
Left = 120
TabIndex = 1
Top = 480
Width = 4215
End
Begin VB.CheckBox chk128
Caption = "Allow passwords up to 128 character(s)"
Height = 315
Left = 120
TabIndex = 0
Top = 240
Width = 4215
End
End
End
Attribute VB_Name = "frmOverride"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub chk128_Click()
If chk256.Value = 0 And chk512.Value = 0 Then
frmPassGen.maxPassLen = 128
Else
If chk128.Value = 1 Then MsgBox "Cannot set as already overridden to 256 or 512 characters checked.", vbExclamation, "Error"
chk128.Value = 0
End If
End Sub
Private Sub chk256_Click()
If chk128.Value = 0 And chk512.Value = 0 Then
frmPassGen.maxPassLen = 256
Else
If chk256.Value = 1 Then MsgBox "Cannot set as already overridden to 128 or 512 characters checked.", vbExclamation, "Error"
chk256.Value = 0
End If
End Sub
Private Sub chk512_Click()
If chk128.Value = 0 And chk256.Value = 0 Then
frmPassGen.maxPassLen = 512
Else
If chk512.Value = 1 Then MsgBox "Cannot set as already overridden to 128 or 256 characters checked.", vbExclamation, "Error"
chk512.Value = 0
End If
End Sub
Private Sub chkDropPIM_Click()
If chkDropPIM.Value = 1 Then
frmPassGen.overridePIM = 92
Else
frmPassGen.overridePIM = frmPassGen.defaultPIM
End If
End Sub
Private Sub chkLimitPIM_Click()
If chkLimitPIM.Value = 1 Then
frmPassGen.passLenPIM = 64
Else
frmPassGen.passLenPIM = frmPassGen.defaultPassLenPIM
End If
End Sub
Private Sub chkRandom_Click()
frmPassGen.moreRandomness = chkRandom.Value
End Sub
Private Sub cmdOkay_Click()
Unload Me
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then Unload Me
End Sub
Private Sub Form_Load()
chk128.Value = IIf(frmPassGen.maxPassLen = 128, 1, 0)
chk256.Value = IIf(frmPassGen.maxPassLen = 256, 1, 0)
chk512.Value = IIf(frmPassGen.maxPassLen = 512, 1, 0)
chkRandom.Value = IIf(frmPassGen.moreRandomness = 1, 1, 0)
chkLimitPIM.Value = IIf(frmPassGen.passLenPIM = 64, 1, 0)
chkDropPIM.Value = IIf(frmPassGen.overridePIM = 92, 1, 0)
End Sub
Private Sub Form_Terminate()
End
' `-> I doubt this has any use; but just incase...
End Sub
Private Sub Form_Unload(Cancel As Integer)
If chk128.Value = 0 And chk256.Value = 0 And chk512.Value = 0 And frmPassGen.maxPassLen <> frmPassGen.defaultMaxPassLen Then frmPassGen.maxPassLen = frmPassGen.defaultMaxPassLen
Call frmPassGen.addLenNumbers
End Sub
' EOF