Skip to content

Commit

Permalink
mglSetSID now tries both md5 and sha256 decrypt to resolve bad decryp…
Browse files Browse the repository at this point in the history
…t error
  • Loading branch information
austinchkuo committed Feb 6, 2024
1 parent ac1ca0a commit 97b956e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions task/mglSetSID.m
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,15 @@ function setSID(sidStr,force,private)

% see if decrypt was successful
if isequal(status,1)
delete(sidDatabaseDecrypt);
disp(sprintf('(mglSetSID) Did not decrypt %s',sidDatabaseFilename));
return
end
disp(sprintf('\n(mglSetSID) sha256 decrypt did not work. Trying md5... (please re-enter password)'));
status = system(sprintf('openssl des3 -d -md md5 -in %s -out %s',sidDatabaseFilename,sidDatabaseDecrypt));

if isequal(status,1)
delete(sidDatabaseDecrypt);
disp(sprintf('(mglSetSID) Did not decrypt %s',sidDatabaseFilename));
return
end
end

% if so, then load it and delete the decrypt file
sidDatabase = myreadtable(sidDatabaseDecrypt);
Expand Down

0 comments on commit 97b956e

Please sign in to comment.