windows: Don't crash and show a warning when FIPS is enabled. Closes #1298
This commit is contained in:
parent
1ed718d29e
commit
06edfd9b0e
|
@ -33,7 +33,20 @@ namespace SparkleLib {
|
||||||
|
|
||||||
bool warn = true;
|
bool warn = true;
|
||||||
if (RequiredFingerprint != null) {
|
if (RequiredFingerprint != null) {
|
||||||
string host_fingerprint = DeriveFingerprint (host_key);
|
string host_fingerprint;
|
||||||
|
|
||||||
|
try {
|
||||||
|
host_fingerprint = DeriveFingerprint (host_key);
|
||||||
|
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
// "Unapproved cryptographic algorithms" won't work when FIPS is enabled on Windows.
|
||||||
|
// Software like Cisco AnyConnect can demand this feature is on, so we show an error
|
||||||
|
SparkleLogger.LogInfo ("Auth", "Unable to derive fingerprint: ", e);
|
||||||
|
this.errors.Add ("error: Can't check fingerprint due to FIPS being enabled");
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (host_fingerprint == null || !RequiredFingerprint.Equals (host_fingerprint)) {
|
if (host_fingerprint == null || !RequiredFingerprint.Equals (host_fingerprint)) {
|
||||||
SparkleLogger.LogInfo ("Auth", "Fingerprint doesn't match");
|
SparkleLogger.LogInfo ("Auth", "Fingerprint doesn't match");
|
||||||
|
|
|
@ -695,7 +695,15 @@ namespace SparkleShare {
|
||||||
string avatars_path = new string [] { Path.GetDirectoryName (this.config.FullPath),
|
string avatars_path = new string [] { Path.GetDirectoryName (this.config.FullPath),
|
||||||
"avatars", size + "x" + size }.Combine ();
|
"avatars", size + "x" + size }.Combine ();
|
||||||
|
|
||||||
string avatar_file_path = Path.Combine (avatars_path, email.MD5 () + ".png");
|
string avatar_file_path;
|
||||||
|
|
||||||
|
try {
|
||||||
|
avatar_file_path = Path.Combine (avatars_path, email.MD5 () + ".png");
|
||||||
|
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
SparkleLogger.LogInfo ("Controller", "Error fetching avatar for " + email, e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
if (File.Exists (avatar_file_path)) {
|
if (File.Exists (avatar_file_path)) {
|
||||||
if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1))
|
if (new FileInfo (avatar_file_path).CreationTime < DateTime.Now.AddDays (-1))
|
||||||
|
|
Loading…
Reference in a new issue