Index: base/win/win_util.cc |
diff --git a/base/win/win_util.cc b/base/win/win_util.cc |
index ee923522fc9f3342a5a6e856931ff11c7fb7545d..69e14e4f6aac04ca330890a177975e15dafc4039 100644 |
--- a/base/win/win_util.cc |
+++ b/base/win/win_util.cc |
@@ -370,6 +370,25 @@ void SetDomainStateForTesting(bool state) { |
g_domain_state = state ? ENROLLED : NOT_ENROLLED; |
} |
+bool MaybeHasSHA256Support() { |
+ const base::win::OSInfo* os_info = base::win::OSInfo::GetInstance(); |
+ |
+ if (os_info->version() == base::win::VERSION_PRE_XP) |
+ return false; // Too old to have it and this OS is not supported anyway. |
+ |
+ if (os_info->version() == base::win::VERSION_XP) |
+ return os_info->service_pack().major >= 3; // Windows XP SP3 has it. |
+ |
+ // Assume it is missing in this case, although it may not be. This category |
+ // includes Windows XP x64, and Windows Server, where a hotfix could be |
+ // deployed. |
+ if (os_info->version() == base::win::VERSION_SERVER_2003) |
+ return false; |
+ |
+ DCHECK(os_info->version() >= base::win::VERSION_VISTA); |
+ return true; // New enough to have SHA-256 support. |
+} |
+ |
} // namespace win |
} // namespace base |