Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Archive
usb-lockdown
Commits
3b17d6fe
Commit
3b17d6fe
authored
Aug 18, 2014
by
theorangeone97
Browse files
removed testing code so it would compile
parent
84cb59fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
USB Lockdown/authentication.cs
View file @
3b17d6fe
...
...
@@ -47,38 +47,11 @@ namespace USB_Lockdown
catch
{
}
if
(
File
.
Exists
(
currentDrive
.
Name
+
"\\LockDown.config"
))
// the first check for a valid drive. Could be something else, but this is a lightweight test to be done first!
{
if
(
driveValidate
(
currentDrive
))
//runs the full validation of the drive
{
validDrive
=
currentDrive
;
driveFound
=
true
;
break
;
}
}
}
}
}
internal
static
bool
driveValidate
(
DriveInfo
drive
){
if
(!
checkHash
(
drive
))
{
return
false
;
}
return
true
;
}
private
static
bool
checkHash
(
DriveInfo
drive
)
{
string
fileName
=
drive
.
Name
+
""
;
if
(!
File
.
Exists
(
fileName
))
{
return
false
;
}
using
(
BinaryReader
reader
=
new
BinaryReader
(
File
.
Open
(
fileName
,
FileMode
.
Open
)))
{
string
hashFromDrive
=
reader
.
ReadString
();
if
(
hashFromDrive
!=
)
}
return
true
;
}
internal
static
void
resetValues
()
{
validDrive
=
null
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment