fix for no old name build

pull/234/head
Jacob Barthelmeh 2020-01-23 08:54:21 -08:00
parent 3a060b1a69
commit f1d00102ba
4 changed files with 17 additions and 17 deletions

View File

@ -544,7 +544,7 @@ typedef struct PwMap {
byte type; byte type;
byte username[32]; byte username[32];
word32 usernameSz; word32 usernameSz;
byte p[SHA256_DIGEST_SIZE]; byte p[WC_SHA256_DIGEST_SIZE];
struct PwMap* next; struct PwMap* next;
} PwMap; } PwMap;
@ -561,7 +561,7 @@ static PwMap* PwMapNew(PwMapList* list, byte type, const byte* username,
map = (PwMap*)malloc(sizeof(PwMap)); map = (PwMap*)malloc(sizeof(PwMap));
if (map != NULL) { if (map != NULL) {
Sha256 sha; wc_Sha256 sha;
byte flatSz[4]; byte flatSz[4];
map->type = type; map->type = type;
@ -741,7 +741,7 @@ static int wsUserAuth(byte authType,
{ {
PwMapList* list; PwMapList* list;
PwMap* map; PwMap* map;
byte authHash[SHA256_DIGEST_SIZE]; byte authHash[WC_SHA256_DIGEST_SIZE];
int ret; int ret;
if (ctx == NULL) { if (ctx == NULL) {
@ -757,7 +757,7 @@ static int wsUserAuth(byte authType,
/* Hash the password or public key with its length. */ /* Hash the password or public key with its length. */
{ {
Sha256 sha; wc_Sha256 sha;
byte flatSz[4]; byte flatSz[4];
wc_InitSha256(&sha); wc_InitSha256(&sha);
if (authType == WOLFSSH_USERAUTH_PASSWORD) { if (authType == WOLFSSH_USERAUTH_PASSWORD) {
@ -785,7 +785,7 @@ static int wsUserAuth(byte authType,
memcmp(authData->username, map->username, map->usernameSz) == 0) { memcmp(authData->username, map->username, map->usernameSz) == 0) {
if (authData->type == map->type) { if (authData->type == map->type) {
if (memcmp(map->p, authHash, SHA256_DIGEST_SIZE) == 0) { if (memcmp(map->p, authHash, WC_SHA256_DIGEST_SIZE) == 0) {
return WOLFSSH_USERAUTH_SUCCESS; return WOLFSSH_USERAUTH_SUCCESS;
} }
else { else {

View File

@ -309,7 +309,7 @@ typedef struct PwMap {
byte type; byte type;
byte username[32]; byte username[32];
word32 usernameSz; word32 usernameSz;
byte p[SHA256_DIGEST_SIZE]; byte p[WC_SHA256_DIGEST_SIZE];
struct PwMap* next; struct PwMap* next;
} PwMap; } PwMap;
@ -326,7 +326,7 @@ static PwMap* PwMapNew(PwMapList* list, byte type, const byte* username,
map = (PwMap*)malloc(sizeof(PwMap)); map = (PwMap*)malloc(sizeof(PwMap));
if (map != NULL) { if (map != NULL) {
Sha256 sha; wc_Sha256 sha;
byte flatSz[4]; byte flatSz[4];
map->type = type; map->type = type;
@ -506,7 +506,7 @@ static int wsUserAuth(byte authType,
{ {
PwMapList* list; PwMapList* list;
PwMap* map; PwMap* map;
byte authHash[SHA256_DIGEST_SIZE]; byte authHash[WC_SHA256_DIGEST_SIZE];
if (ctx == NULL) { if (ctx == NULL) {
fprintf(stderr, "wsUserAuth: ctx not set"); fprintf(stderr, "wsUserAuth: ctx not set");
@ -521,7 +521,7 @@ static int wsUserAuth(byte authType,
/* Hash the password or public key with its length. */ /* Hash the password or public key with its length. */
{ {
Sha256 sha; wc_Sha256 sha;
byte flatSz[4]; byte flatSz[4];
wc_InitSha256(&sha); wc_InitSha256(&sha);
if (authType == WOLFSSH_USERAUTH_PASSWORD) { if (authType == WOLFSSH_USERAUTH_PASSWORD) {
@ -549,7 +549,7 @@ static int wsUserAuth(byte authType,
memcmp(authData->username, map->username, map->usernameSz) == 0) { memcmp(authData->username, map->username, map->usernameSz) == 0) {
if (authData->type == map->type) { if (authData->type == map->type) {
if (memcmp(map->p, authHash, SHA256_DIGEST_SIZE) == 0) { if (memcmp(map->p, authHash, WC_SHA256_DIGEST_SIZE) == 0) {
return WOLFSSH_USERAUTH_SUCCESS; return WOLFSSH_USERAUTH_SUCCESS;
} }
else { else {

View File

@ -434,7 +434,7 @@ WOLFSSH* SshInit(WOLFSSH* ssh, WOLFSSH_CTX* ctx)
#define RNG WC_RNG #define RNG WC_RNG
#endif #endif
HandshakeInfo* handshake; HandshakeInfo* handshake;
RNG* rng; WC_RNG* rng;
void* heap; void* heap;
WLOG(WS_LOG_DEBUG, "Entering SshInit()"); WLOG(WS_LOG_DEBUG, "Entering SshInit()");
@ -444,7 +444,7 @@ WOLFSSH* SshInit(WOLFSSH* ssh, WOLFSSH_CTX* ctx)
heap = ctx->heap; heap = ctx->heap;
handshake = HandshakeInfoNew(heap); handshake = HandshakeInfoNew(heap);
rng = (RNG*)WMALLOC(sizeof(RNG), heap, DYNTYPE_RNG); rng = (WC_RNG*)WMALLOC(sizeof(WC_RNG), heap, DYNTYPE_RNG);
if (handshake == NULL || rng == NULL || wc_InitRng(rng) != 0) { if (handshake == NULL || rng == NULL || wc_InitRng(rng) != 0) {
@ -1883,11 +1883,11 @@ static INLINE byte MacSzForId(byte id)
{ {
switch (id) { switch (id) {
case ID_HMAC_SHA1: case ID_HMAC_SHA1:
return SHA_DIGEST_SIZE; return WC_SHA_DIGEST_SIZE;
case ID_HMAC_SHA1_96: case ID_HMAC_SHA1_96:
return SHA1_96_SZ; return SHA1_96_SZ;
case ID_HMAC_SHA2_256: case ID_HMAC_SHA2_256:
return SHA256_DIGEST_SIZE; return WC_SHA256_DIGEST_SIZE;
default: default:
return 0; return 0;
} }
@ -1899,9 +1899,9 @@ static INLINE byte KeySzForId(byte id)
switch (id) { switch (id) {
case ID_HMAC_SHA1: case ID_HMAC_SHA1:
case ID_HMAC_SHA1_96: case ID_HMAC_SHA1_96:
return SHA_DIGEST_SIZE; return WC_SHA_DIGEST_SIZE;
case ID_HMAC_SHA2_256: case ID_HMAC_SHA2_256:
return SHA256_DIGEST_SIZE; return WC_SHA256_DIGEST_SIZE;
case ID_AES128_CBC: case ID_AES128_CBC:
case ID_AES128_CTR: case ID_AES128_CTR:
case ID_AES128_GCM: case ID_AES128_GCM:

View File

@ -112,7 +112,7 @@ enum {
#define MAX_INTEGRITY 2 #define MAX_INTEGRITY 2
#define MAX_KEY_EXCHANGE 2 #define MAX_KEY_EXCHANGE 2
#define MAX_PUBLIC_KEY 1 #define MAX_PUBLIC_KEY 1
#define MAX_HMAC_SZ SHA256_DIGEST_SIZE #define MAX_HMAC_SZ WC_SHA256_DIGEST_SIZE
#define MIN_BLOCK_SZ 8 #define MIN_BLOCK_SZ 8
#define COOKIE_SZ 16 #define COOKIE_SZ 16
#define LENGTH_SZ 4 #define LENGTH_SZ 4