File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ class zero_memory_deleter
51
51
};
52
52
typedef std::unique_ptr<std::wstring, zero_memory_deleter> plaintext_string;
53
53
#if defined(__cplusplus_winrt)
54
+ #if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP && _MSC_VER < 1800)
54
55
class winrt_encryption
55
56
{
56
57
public:
@@ -60,6 +61,7 @@ class winrt_encryption
60
61
private:
61
62
::pplx::task<Windows::Storage::Streams::IBuffer ^> m_buffer;
62
63
};
64
+ #endif
63
65
#else
64
66
class win32_encryption
65
67
{
@@ -138,14 +140,23 @@ class credentials
138
140
#if defined(_MS_WINDOWS)
139
141
details::plaintext_string decrypt () const
140
142
{
143
+ // Encryption APIs not supported on Windows Phone 8.0
144
+ #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP && _MSC_VER < 1800
145
+ return plaintext_string (new string_t (m_password));
146
+ #else
141
147
return m_password.decrypt ();
148
+ #endif
142
149
}
143
150
#endif
144
151
145
152
::utility::string_t m_username;
146
153
#if defined(_MS_WINDOWS)
147
154
#if defined(__cplusplus_winrt)
155
+ #if WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP && _MSC_VER < 1800
156
+ ::utility::string_t m_password;
157
+ #else
148
158
details::winrt_encryption m_password;
159
+ #endif
149
160
#else
150
161
details::win32_encryption m_password;
151
162
#endif
Original file line number Diff line number Diff line change @@ -42,6 +42,9 @@ namespace details
42
42
#if defined(_MS_WINDOWS)
43
43
#if defined(__cplusplus_winrt)
44
44
45
+ // Not available on Windows Phone 8.0
46
+ #if !(WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP && _MSC_VER < 1800)
47
+
45
48
// Helper function to zero out memory of an IBuffer.
46
49
void winrt_secure_zero_buffer (Windows::Storage::Streams::IBuffer ^buffer)
47
50
{
@@ -91,6 +94,7 @@ plaintext_string winrt_encryption::decrypt() const
91
94
SecureZeroMemory (rawPlaintext, plaintext->Length );
92
95
return std::move (data);
93
96
}
97
+ #endif
94
98
#else
95
99
win32_encryption::win32_encryption (const std::wstring &data) :
96
100
m_numCharacters(data.size())
You can’t perform that action at this time.
0 commit comments