--- /dev/null
+/**\r
+ * Copyright (c) 2010 Florian Forster\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy\r
+ * of this software and associated documentation files (the "Software"), to deal\r
+ * in the Software without restriction, including without limitation the rights\r
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
+ * copies of the Software, and to permit persons to whom the Software is\r
+ * furnished to do so, subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in\r
+ * all copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
+ * THE SOFTWARE.\r
+ **/\r
+\r
+#include "create_hmac.h"\r
+\r
+#include <stdlib.h>\r
+#include <stdio.h>\r
+#include <assert.h>\r
+\r
+/*\r
+ * Creating a HCRYPTKEY from a plain text password is probably the most tricky\r
+ * part when calculating an RFC2104 HMAC using Microsoft CryptoAPI. The\r
+ * examples provided at the MSDN website encourage you to use "CryptDeriveKey",\r
+ * which doesn't do the conditional hashing required by HMAC. (That is, it\r
+ * might. The documentation on any of the functions is so vague that it's well\r
+ * possible the elegant solution is just not documented nor demonstrated.\r
+ */\r
+static HCRYPTKEY create_hmac_key_exact (HCRYPTPROV hProv,\r
+ BYTE *pbKey, DWORD dwKeySize)\r
+{\r
+ /* Layout of the memory expected when importing a plain text blob is\r
+ * documented at the "CryptImportKey" under "Remarks". The four bytes\r
+ * following the PUBLICKEYSTRUC structure hold the size of the key, then\r
+ * follows the key itself. */\r
+ struct plain_text_data_s\r
+ {\r
+ PUBLICKEYSTRUC blob;\r
+ DWORD key_size;\r
+ } *data;\r
+ DWORD data_size;\r
+ HCRYPTKEY ret_key = 0;\r
+ BOOL status;\r
+\r
+ data_size = sizeof (*data) + dwKeySize;\r
+ data = (struct plain_text_data_s *) malloc (data_size);\r
+ if (data == NULL)\r
+ return (0);\r
+ memset (data, 0, data_size);\r
+\r
+ /* The key is not encrypted. */\r
+ data->blob.bType = PLAINTEXTKEYBLOB;\r
+ data->blob.bVersion = CUR_BLOB_VERSION;\r
+ data->blob.reserved = 0;\r
+ /* The "CryptImportKey" page explicitly states that "RC2" is to be used for\r
+ * HMAC keys. What anyone might have been thinking, I don't know. */\r
+ data->blob.aiKeyAlg = CALG_RC2;\r
+\r
+ /* Copy the key to the memory right behind the struct. "memcpy" should only\r
+ * add memory protection crap *after* the region written to, so the blob\r
+ * shouldn't be destroyed. We play it save, though, and set the key size\r
+ * last. Should problems arise, we should switch to a loop just to be sure. */\r
+ memcpy (data + 1, pbKey, dwKeySize);\r
+ data->key_size = dwKeySize;\r
+\r
+ /* Actually convert our memory region to this mysterious key structure.\r
+ * The "CRYPT_IPSEC_HMAC_KEY" is required to allow RC2 keys longer than\r
+ * 16 byte. Again, this is documented on the "CryptImportKey" page as a\r
+ * side note. */\r
+ status = CryptImportKey (hProv, (BYTE *) data, sizeof (data),\r
+ /* public key = */ 0,\r
+ /* flags = */ CRYPT_IPSEC_HMAC_KEY,\r
+ &ret_key);\r
+ if (!status)\r
+ {\r
+ free (data);\r
+ return (0);\r
+ }\r
+\r
+ free (data);\r
+ return (ret_key);\r
+} /* HCRYPTKEY create_hmac_key_exact */\r
+\r
+/* If the key of the HMAC is larger than the hash size, use the hash of the\r
+ * key instead of using the key directly. */\r
+static HCRYPTKEY create_hmac_key_hashed (HCRYPTPROV hProv,\r
+ BYTE *pbKey, DWORD dwKeySize,\r
+ DWORD dwHashSize, HCRYPTHASH hHash)\r
+{\r
+ BOOL status;\r
+ BYTE *hash_data;\r
+ DWORD hash_data_size;\r
+ HCRYPTKEY key;\r
+\r
+ assert (dwKeySize > dwHashSize);\r
+\r
+ status = CryptHashData (hHash, pbKey, dwKeySize, /* dwFlags = */ 0);\r
+ if (!status)\r
+ return (0);\r
+\r
+ hash_data = (BYTE *) malloc (dwHashSize);\r
+ if (hash_data == NULL)\r
+ return (0);\r
+ memset (hash_data, 0, dwHashSize);\r
+ hash_data_size = dwHashSize;\r
+\r
+ status = CryptGetHashParam (hHash, HP_HASHVAL,\r
+ hash_data, &hash_data_size, /* flags = */ 0);\r
+ if (!status)\r
+ {\r
+ free (hash_data);\r
+ return (0);\r
+ }\r
+\r
+ assert (hash_data_size == dwHashSize);\r
+\r
+ key = create_hmac_key_exact (hProv, hash_data, hash_data_size);\r
+\r
+ free (hash_data);\r
+ return (key);\r
+} /* HCRYPTKEY create_hmac_key_hashed */\r
+\r
+/* If the key is short enough, it is (right-)padded with zeros and otherwise\r
+ * used as-is. */\r
+static HCRYPTKEY create_hmac_key_padded (HCRYPTPROV hProv,\r
+ BYTE *pbKey, DWORD dwKeySize,\r
+ DWORD dwHashSize)\r
+{\r
+ BYTE *padded_key;\r
+ HCRYPTKEY key;\r
+ DWORD i;\r
+\r
+ assert (dwKeySize <= dwHashSize);\r
+\r
+ if (dwKeySize == dwHashSize)\r
+ return (create_hmac_key_exact (hProv, pbKey, dwKeySize));\r
+\r
+ padded_key = (BYTE *) malloc (dwHashSize);\r
+ if (padded_key == NULL)\r
+ return (0);\r
+\r
+ /* Copy the key and right-pad with zeros. Don't use "memcpy" here because\r
+ * the fucked up version of VS will corrupt memory. */\r
+ for (i = 0; i < dwHashSize; i++)\r
+ padded_key[i] = (i < dwKeySize) ? pbKey[i] : 0;\r
+\r
+ key = create_hmac_key_exact (hProv, padded_key, dwHashSize);\r
+\r
+ free (padded_key);\r
+ return (key);\r
+} /* HCRYPTKEY create_hmac_key_padded */\r
+\r
+static HCRYPTKEY create_hmac_key (HCRYPTPROV hProv,\r
+ ALG_ID Algid,\r
+ BYTE *pbKey, DWORD dwKeySize)\r
+{\r
+ HCRYPTHASH hash = 0;\r
+ HCRYPTKEY key;\r
+ DWORD hash_size = 0;\r
+ DWORD param_size;\r
+ BOOL status;\r
+\r
+ /* Allocate a hash object to determine the hash size. */\r
+ status = CryptCreateHash (hProv, Algid,\r
+ /* hKey = */ 0,\r
+ /* dwFlags = */ 0,\r
+ /* out phHash = */ &hash);\r
+ if (!status)\r
+ return (0);\r
+\r
+ param_size = (DWORD) sizeof (hash_size);\r
+ status = CryptGetHashParam (hash, HP_HASHSIZE,\r
+ (BYTE *) &hash_size, ¶m_size,\r
+ /* flags = */ 0);\r
+ if (!status)\r
+ {\r
+ CryptDestroyHash (hash);\r
+ return (0);\r
+ }\r
+\r
+ /* Determine whether we need to calculate the hash of the key or if\r
+ * padding is sufficient. */\r
+ if (dwKeySize > hash_size)\r
+ key = create_hmac_key_hashed (hProv, pbKey, dwKeySize, hash_size, hash);\r
+ else\r
+ key = create_hmac_key_padded (hProv, pbKey, dwKeySize, hash_size);\r
+\r
+ CryptDestroyHash (hash);\r
+ return (key);\r
+} /* HCRYPTKEY create_hmac_key */\r
+\r
+BOOL CreateHMAC (HCRYPTPROV hProv,\r
+ ALG_ID Algid,\r
+ BYTE *pbKey, DWORD dwKeySize,\r
+ DWORD dwFlags,\r
+ HCRYPTHASH *phHash,\r
+ HCRYPTKEY *phKey)\r
+{\r
+ HCRYPTKEY hmac_key;\r
+ HCRYPTHASH hash = 0;\r
+ HMAC_INFO hmac_info;\r
+ BOOL status;\r
+\r
+ hmac_key = create_hmac_key (hProv, Algid, pbKey, dwKeySize);\r
+ if (hmac_key == 0)\r
+ return (FALSE);\r
+\r
+ status = CryptCreateHash (hProv, CALG_HMAC, hmac_key,\r
+ /* flags = */ dwFlags,\r
+ &hash);\r
+ if (!status)\r
+ {\r
+ CryptDestroyKey (hmac_key);\r
+ return (status);\r
+ }\r
+\r
+ memset (&hmac_info, 0, sizeof (hmac_info));\r
+ hmac_info.HashAlgid = Algid;\r
+ hmac_info.pbInnerString = NULL;\r
+ hmac_info.cbInnerString = 0;\r
+ hmac_info.pbOuterString = NULL;\r
+ hmac_info.cbOuterString = 0;\r
+\r
+ status = CryptSetHashParam (hash, HP_HMAC_INFO, (BYTE *) &hmac_info,\r
+ /* flags = */ 0);\r
+ if (!status)\r
+ {\r
+ CryptDestroyHash (hash);\r
+ CryptDestroyKey (hmac_key);\r
+ return (status);\r
+ }\r
+\r
+ *phHash = hash;\r
+ *phKey = hmac_key;\r
+ return (TRUE);\r
+} /* BOOL CreateHMAC */\r
+\r
+BOOL DestroyHMAC (HCRYPTHASH hHash, HCRYPTKEY hKey)\r
+{\r
+ if (hHash != 0)\r
+ CryptDestroyHash (hHash);\r
+\r
+ if (hKey != 0)\r
+ CryptDestroyKey (hKey);\r
+\r
+ return (TRUE);\r
+} /* BOOL DestroyHMAC */\r
+\r
+/* vim: set ts=4 sw=4 noet : */\r
--- /dev/null
+/*
+ * These SHA-2 test vectors were taken from RFC 4231 which is available from
+ * the IETF website.
+ */
+
+struct testcase_s
+{
+ BYTE *key;
+ DWORD key_size;
+ BYTE *data;
+ DWORD data_size;
+
+ BYTE sha224[28];
+ BYTE sha256[32];
+ BYTE sha384[48];
+ BYTE sha512[64];
+};
+typedef struct testcase_s testcase_t;
+
+BYTE testcase1_key[] =
+{
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
+ 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b
+};
+
+BYTE testcase1_data[] =
+{
+ 0x48, 0x69, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65
+};
+
+testcase_t testcase1 =
+{
+ testcase1_key,
+ sizeof (testcase1_key),
+ testcase1_data,
+ sizeof (testcase1_data),
+ { /* SHA-224 */
+ 0x89, 0x6f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, 0x54
+ }
+};
+
+BYTE testcase2_key[] =
+{
+ 0x4a, 0x65, 0x66, 0x65
+};
+
+BYTE testcase2_data[] =
+{
+ 0x77, 0x68, 0x61, 0x74, 0x20, 0x64, 0x6f, 0x20, 0x79, 0x61, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20,
+ 0x66, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x3f
+};
+
+testcase_t testcase2 =
+{
+ testcase2_key,
+ sizeof (testcase2_key),
+ testcase2_data,
+ sizeof (testcase2_data),
+ { /* SHA-224 */
+ 0xa3, 0x0e, 0x01, 0x09, 0x8b, 0xc6, 0xdb, 0xbf, 0x45, 0x69, 0x0f, 0x3a, 0x7e, 0x9e, 0x6d, 0x0f,
+ 0x8b, 0xbe, 0xa2, 0xa3, 0x9e, 0x61, 0x48, 0x00, 0x8f, 0xd0, 0x5e, 0x44
+ },
+ { /* SHA-256 */
+ 0x5b, 0xdc, 0xc1, 0x46, 0xbf, 0x60, 0x75, 0x4e, 0x6a, 0x04, 0x24, 0x26, 0x08, 0x95, 0x75, 0xc7,
+ 0x5a, 0x00, 0x3f, 0x08, 0x9d, 0x27, 0x39, 0x83, 0x9d, 0xec, 0x58, 0xb9, 0x64, 0xec, 0x38, 0x43
+ },
+ { /* SHA-384 */
+ 0xaf, 0x45, 0xd2, 0xe3, 0x76, 0x48, 0x40, 0x31, 0x61, 0x7f, 0x78, 0xd2, 0xb5, 0x8a, 0x6b, 0x1b,
+ 0x9c, 0x7e, 0xf4, 0x64, 0xf5, 0xa0, 0x1b, 0x47, 0xe4, 0x2e, 0xc3, 0x73, 0x63, 0x22, 0x44, 0x5e,
+ 0x8e, 0x22, 0x40, 0xca, 0x5e, 0x69, 0xe2, 0xc7, 0x8b, 0x32, 0x39, 0xec, 0xfa, 0xb2, 0x16, 0x49
+ },
+ { /* SHA-512 */
+ 0x16, 0x4b, 0x7a, 0x7b, 0xfc, 0xf8, 0x19,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, 0x72, 0x73, 0x74
+};
+
+testcase_t testcase6 =
+{
+ testcase6_key,
+ sizeof (testcase6_key),
+ testcase6_data,
+ sizeof (testcase6_data),
+ { /* SHA-224 */
+ 0x95, 0xe9, 0xa0, 0xdb, 0x96, 0x20, 0x95, 0xad, 0xae, 0xbe, 0x9b, 0x2d, 0x6f, 0x0d, 0xbc, 0xe2,
+ 0xd4, 0x99, 0xf1, 0x12, 0xf2, 0xd2, 0xb7, 0x27, 0x3f, 0xa6, 0x87, 0x0e
+ },
+ { /* SHA-256 */
+ 0x60, 0xe4, 0x31, 0x59, 0x1e, 0xe0, 0xb6, 0x7f, 0x0d, 0x8a, 0x26, 0xaa, 0xcb, 0xf5, 0xb7, 0x7f,
+ 0x8e, 0x0b, 0xc6, 0x21, 0x37, 0x28, 0xc5, 0x14, 0x05, 0x46, 0x04, 0x0f, 0x0e, 0xe3, 0x7f, 0x54
+ },
+ { /* SHA-384 */
+ 0x4e, 0xce, 0x08, 0x44, 0x85, 0x81, 0x3e, 0x90, 0x88, 0xd2, 0xc6, 0x3a, 0x04, 0x1b, 0xc5, 0xb4,
+ 0x4f, 0x9e, 0xf1, 0x01, 0x2a, 0x2b, 0x58, 0x8f, 0x3c, 0xd1, 0x1f, 0x05, 0x03, 0x3a, 0xc4, 0xc6,
+ 0x0c, 0x2e, 0xf6, 0xab, 0x40, 0x30, 0xfe, 0x82, 0x96, 0x24, 0x8d, 0xf1, 0x63, 0xf4, 0x49, 0x52
+ },
+ { /* SHA-512 */
+ 0x80, 0xb2, 0x42, 0x63, 0xc7, 0xc1, 0xa3, 0xeb, 0xb7, 0x14, 0x93, 0xc1, 0xdd, 0x7b, 0xe8, 0xb4,
+ 0x9b, 0x46, 0xd1, 0xf4, 0x1b, 0x4a, 0xee, 0xc1, 0x12, 0x1b, 0x01, 0x37, 0x83, 0xf8, 0xf3, 0x52,
+ 0x6b, 0x56, 0xd0, 0x37, 0xe0, 0x5f, 0x25, 0x98, 0xbd, 0x0f, 0xd2,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