ReactOS 0.4.17-dev-1005-g171e1de
ssh_kdf_sha256.c File Reference
#include "precomp.h"
Include dependency graph for ssh_kdf_sha256.c:

Go to the source code of this file.

Functions

VOID SYMCRYPT_CALL SymCryptSshKdfSha256SelfTest (void)
 

Variables

static const BYTE pbKey []
 
static const BYTE pbHash []
 
static const BYTE pbSessionId []
 
static const BYTE label = SYMCRYPT_SSHKDF_ENCRYPTION_KEY_CLIENT_TO_SERVER
 
static const BYTE pbResult []
 

Function Documentation

◆ SymCryptSshKdfSha256SelfTest()

VOID SYMCRYPT_CALL SymCryptSshKdfSha256SelfTest ( void  )

Definition at line 45 of file ssh_kdf_sha256.c.

46{
48 SYMCRYPT_ALIGN BYTE rbResult[sizeof(pbResult)];
49
51
52 SymCryptSshKdfDerive(&expandedKey,
53 pbHash, sizeof(pbHash),
54 label,
55 pbSessionId, sizeof(pbSessionId),
56 rbResult, sizeof(rbResult)
57 );
58
59 SymCryptInjectError(rbResult, sizeof(rbResult));
60
61 if (memcmp(rbResult, pbResult, sizeof(pbResult)) != 0)
62 {
63 SymCryptFatal('sshk');
64 }
65}
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
VOID SYMCRYPT_CALL SymCryptInjectError(PBYTE pbData, SIZE_T cbData)
static const BYTE label
static const BYTE pbHash[]
static const BYTE pbSessionId[]
static const BYTE pbResult[]
_Analysis_noreturn_ VOID SYMCRYPT_CALL SymCryptFatal(UINT32 fatalCode)
const PCSYMCRYPT_HASH SymCryptSha256Algorithm
Definition: sha256.c:46
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSshKdfExpandKey(_Out_ PSYMCRYPT_SSHKDF_EXPANDED_KEY pExpandedKey, _In_ PCSYMCRYPT_HASH pHashFunc, _In_reads_(cbKey) PCBYTE pbKey, SIZE_T cbKey)
Definition: ssh_kdf.c:17
SYMCRYPT_ERROR SYMCRYPT_CALL SymCryptSshKdfDerive(_In_ PCSYMCRYPT_SSHKDF_EXPANDED_KEY pExpandedKey, _In_reads_(cbHashValue) PCBYTE pbHashValue, SIZE_T cbHashValue, BYTE label, _In_reads_(cbSessionId) PCBYTE pbSessionId, SIZE_T cbSessionId, _Inout_updates_(cbOutput) PBYTE pbOutput, SIZE_T cbOutput)
Definition: ssh_kdf.c:33
#define SYMCRYPT_ALIGN
PCBYTE pbKey
unsigned char BYTE
Definition: xxhash.c:193

Variable Documentation

◆ label

◆ pbHash

◆ pbKey

const BYTE pbKey[]
static
Initial value:
=
{
0x00, 0x00, 0x00, 0x81, 0x00, 0x87, 0x5c, 0x55, 0x1c, 0xef, 0x52, 0x6a, 0x4a, 0x8b, 0xe1, 0xa7,
0xdf, 0x27, 0xe9, 0xed, 0x35, 0x4b, 0xac, 0x9a, 0xfb, 0x71, 0xf5, 0x3d, 0xba, 0xe9, 0x05, 0x67,
0x9d, 0x14, 0xf9, 0xfa, 0xf2, 0x46, 0x9c, 0x53, 0x45, 0x7c, 0xf8, 0x0a, 0x36, 0x6b, 0xe2, 0x78,
0x96, 0x5b, 0xa6, 0x25, 0x52, 0x76, 0xca, 0x2d, 0x9f, 0x4a, 0x97, 0xd2, 0x71, 0xf7, 0x1e, 0x50,
0xd8, 0xa9, 0xec, 0x46, 0x25, 0x3a, 0x6a, 0x90, 0x6a, 0xc2, 0xc5, 0xe4, 0xf4, 0x8b, 0x27, 0xa6,
0x3c, 0xe0, 0x8d, 0x80, 0x39, 0x0a, 0x49, 0x2a, 0xa4, 0x3b, 0xad, 0x9d, 0x88, 0x2c, 0xca, 0xc2,
0x3d, 0xac, 0x88, 0xbc, 0xad, 0xa4, 0xb4, 0xd4, 0x26, 0xa3, 0x62, 0x08, 0x3d, 0xab, 0x65, 0x69,
0xc5, 0x4c, 0x22, 0x4d, 0xd2, 0xd8, 0x76, 0x43, 0xaa, 0x22, 0x76, 0x93, 0xe1, 0x41, 0xad, 0x16,
0x30, 0xce, 0x13, 0x14, 0x4e
}

Definition at line 11 of file ssh_kdf_sha256.c.

◆ pbResult

const BYTE pbResult[]
static
Initial value:
=
{
0x4a, 0x63, 0x14, 0xd2, 0xf7, 0x51, 0x1b, 0xf8, 0x8f, 0xad, 0x39, 0xfb, 0x68, 0x92, 0xf3, 0xf2, 0x18, 0xca, 0xfd, 0x53, 0x0e, 0x72, 0xfe, 0x43
}

Definition at line 38 of file ssh_kdf_sha256.c.

Referenced by QueryBool(), QueryByte(), SYMCRYPT_HmacXxx(), SYMCRYPT_HmacXxxResult(), SYMCRYPT_Xxx(), SYMCRYPT_XxxDefault(), SYMCRYPT_XxxEx(), SYMCRYPT_XxxExtract(), SYMCRYPT_XxxResult(), SymCryptAesCmac(), SymCryptAesCmacResult(), SymCryptGHashResult(), SymCryptHash(), SymCryptHashResult(), SymCryptHkdf(), SymCryptHkdfDerive(), SymCryptHmac(), SymCryptHmacResult(), SymCryptHmacSha3_224(), SymCryptHmacSha3_224Result(), SymCryptHmacSha3_256(), SymCryptHmacSha3_256Result(), SymCryptHmacSha3_384(), SymCryptHmacSha3_384Result(), SymCryptHmacSha3_512(), SymCryptHmacSha3_512Result(), SymCryptKeccakExtract(), SymCryptKeccakExtractLanes(), SymCryptMarvin32(), SymCryptMarvin32Result(), SymCryptMd2Result(), SymCryptMd4Result(), SymCryptMd5Result(), SymCryptPbkdf2(), SymCryptPbkdf2Derive(), SymCryptPoly1305(), SymCryptPoly1305Result(), SymCryptRngAesBcc(), SymCryptSha1Result(), SymCryptSha224Result(), SymCryptSha256Result(), SymCryptSha384Result(), SymCryptSha3_224Result(), SymCryptSha3_256Result(), SymCryptSha3_384Result(), SymCryptSha3_512Result(), SymCryptSha512_224Result(), SymCryptSha512_256Result(), SymCryptSha512Result(), SymCryptSp800_108(), SymCryptSp800_108Derive(), SymCryptSshKdfSha256SelfTest(), SymCryptSskdfHash(), SymCryptSskdfMac(), SymCryptSskdfMacDerive(), SymCryptTlsPrf1_1(), SymCryptTlsPrf1_1Derive(), SymCryptTlsPrf1_2(), SymCryptTlsPrf1_2Derive(), SymCryptTlsPrfMac(), SymCryptTlsPrfPHash(), SymCryptUint32ToLsbFirst(), SymCryptUint32ToMsbFirst(), SymCryptUint64ToLsbFirst(), SymCryptUint64ToMsbFirst(), and SymCryptXorBytes().

◆ pbSessionId

const BYTE pbSessionId[]
static
Initial value:
=
{
0x0e, 0x68, 0x3f, 0xc8, 0xa9, 0xed, 0x7c, 0x2f, 0xf0, 0x2d, 0xef, 0x23, 0xb2, 0x74, 0x5e, 0xbc,
0x99, 0xb2, 0x67, 0xda, 0xa8, 0x6a, 0x4a, 0xa7, 0x69, 0x72, 0x39, 0x08, 0x82, 0x53, 0xf6, 0x42
}

Definition at line 30 of file ssh_kdf_sha256.c.

Referenced by SymCryptSshKdf(), SymCryptSshKdfDerive(), and SymCryptSshKdfSha256SelfTest().