@@ -60,7 +60,7 @@ namespace experimental
60
60
#include < bcrypt.h>
61
61
62
62
std::vector<unsigned char > oauth1_config::_hmac_sha1 (const utility::string_t & key, const utility::string_t & data)
63
- {
63
+ {
64
64
NTSTATUS status;
65
65
BCRYPT_ALG_HANDLE alg_handle = nullptr ;
66
66
BCRYPT_HASH_HANDLE hash_handle = nullptr ;
@@ -112,7 +112,7 @@ std::vector<unsigned char> oauth1_config::_hmac_sha1(const utility::string_t& ke
112
112
BCryptCloseAlgorithmProvider (alg_handle, 0 );
113
113
}
114
114
115
- return hash;
115
+ return hash;
116
116
}
117
117
118
118
#elif defined(_MS_WINDOWS) && defined(__cplusplus_winrt) // Windows RT
@@ -122,7 +122,7 @@ using namespace Windows::Security::Cryptography::Core;
122
122
using namespace Windows ::Storage::Streams;
123
123
124
124
std::vector<unsigned char > oauth1_config::_hmac_sha1 (const utility::string_t & key, const utility::string_t & data)
125
- {
125
+ {
126
126
Platform::String^ data_str = ref new Platform::String (data.c_str ());
127
127
Platform::String^ key_str = ref new Platform::String (key.c_str ());
128
128
@@ -135,23 +135,23 @@ std::vector<unsigned char> oauth1_config::_hmac_sha1(const utility::string_t& ke
135
135
136
136
Platform::Array<unsigned char , 1 >^ arr;
137
137
CryptographicBuffer::CopyToByteArray (signed_buffer, &arr);
138
- return std::vector<unsigned char >(arr->Data , arr->Data + arr->Length );
138
+ return std::vector<unsigned char >(arr->Data , arr->Data + arr->Length );
139
139
}
140
140
141
141
#else // Linux, Mac OS X
142
142
143
143
#include < openssl/hmac.h>
144
144
145
145
std::vector<unsigned char > oauth1_config::_hmac_sha1 (const utility::string_t & key, const utility::string_t & data)
146
- {
146
+ {
147
147
unsigned char digest[HMAC_MAX_MD_CBLOCK];
148
148
unsigned int digest_len = 0 ;
149
149
150
150
HMAC (EVP_sha1 (), key.c_str (), static_cast <int >(key.length ()),
151
151
(const unsigned char *) data.c_str (), data.length (),
152
152
digest, &digest_len);
153
153
154
- return std::vector<unsigned char >(digest, digest + digest_len);
154
+ return std::vector<unsigned char >(digest, digest + digest_len);
155
155
}
156
156
157
157
#endif
0 commit comments