Peer review feedback.
parent
df2191396e
commit
0cfab1d5e4
|
@ -281,6 +281,9 @@ static int myRsaPssSign(WOLFSSL* ssl, const byte* in, word32 inSz,
|
||||||
hashType = WC_HASH_TYPE_SHA512;
|
hashType = WC_HASH_TYPE_SHA512;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
hashType = WC_HASH_TYPE_NONE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wc_InitRsaKey(&cbInfo->keyRsa, NULL);
|
ret = wc_InitRsaKey(&cbInfo->keyRsa, NULL);
|
||||||
|
@ -331,6 +334,13 @@ int main(int argc, char** argv)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef HAVE_PK_CALLBACKS
|
||||||
|
printf("Warning: PK not compiled in! Please configure wolfSSL with "
|
||||||
|
" --enable-pkcallbacks and try again\n");
|
||||||
|
ret = -1;
|
||||||
|
goto exit;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Create a socket that uses an internet IPv4 address,
|
/* Create a socket that uses an internet IPv4 address,
|
||||||
* Sets the socket to be stream based (TCP),
|
* Sets the socket to be stream based (TCP),
|
||||||
* 0 means choose the default protocol. */
|
* 0 means choose the default protocol. */
|
||||||
|
@ -364,7 +374,7 @@ int main(int argc, char** argv)
|
||||||
/*---------------------------------*/
|
/*---------------------------------*/
|
||||||
/* Start of wolfSSL initialization and configuration */
|
/* Start of wolfSSL initialization and configuration */
|
||||||
/*---------------------------------*/
|
/*---------------------------------*/
|
||||||
#if 1
|
#if 0
|
||||||
wolfSSL_Debugging_ON();
|
wolfSSL_Debugging_ON();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -387,7 +397,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PK_CALLBACKS
|
#ifdef HAVE_PK_CALLBACKS
|
||||||
/* register a sign callbacks for the long term key */
|
/* register sign callbacks for the long term key */
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
wolfSSL_CTX_SetEccSignCb(ctx, myEccSign);
|
wolfSSL_CTX_SetEccSignCb(ctx, myEccSign);
|
||||||
#endif
|
#endif
|
||||||
|
@ -397,9 +407,6 @@ int main(int argc, char** argv)
|
||||||
wolfSSL_CTX_SetRsaPssSignCb(ctx, myRsaPssSign);
|
wolfSSL_CTX_SetRsaPssSignCb(ctx, myRsaPssSign);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
printf("Warning: PK not compiled in! Please configure wolfSSL with "
|
|
||||||
" --enable-pkcallbacks and try again\n");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Mutual Authentication */
|
/* Mutual Authentication */
|
||||||
|
|
|
@ -280,6 +280,9 @@ static int myRsaPssSign(WOLFSSL* ssl, const byte* in, word32 inSz,
|
||||||
hashType = WC_HASH_TYPE_SHA512;
|
hashType = WC_HASH_TYPE_SHA512;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
default:
|
||||||
|
hashType = WC_HASH_TYPE_NONE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = wc_InitRsaKey(&cbInfo->keyRsa, NULL);
|
ret = wc_InitRsaKey(&cbInfo->keyRsa, NULL);
|
||||||
|
@ -330,6 +333,13 @@ int main(int argc, char** argv)
|
||||||
WOLFSSL_CTX* ctx = NULL;
|
WOLFSSL_CTX* ctx = NULL;
|
||||||
WOLFSSL* ssl = NULL;
|
WOLFSSL* ssl = NULL;
|
||||||
|
|
||||||
|
#ifndef HAVE_PK_CALLBACKS
|
||||||
|
printf("Warning: PK not compiled in! Please configure wolfSSL with "
|
||||||
|
" --enable-pkcallbacks and try again\n");
|
||||||
|
ret = -1;
|
||||||
|
goto exit;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the server address struct with zeros */
|
/* Initialize the server address struct with zeros */
|
||||||
memset(&servAddr, 0, sizeof(servAddr));
|
memset(&servAddr, 0, sizeof(servAddr));
|
||||||
|
|
||||||
|
@ -376,7 +386,7 @@ int main(int argc, char** argv)
|
||||||
/*---------------------------------*/
|
/*---------------------------------*/
|
||||||
/* Start of wolfSSL initialization and configuration */
|
/* Start of wolfSSL initialization and configuration */
|
||||||
/*---------------------------------*/
|
/*---------------------------------*/
|
||||||
#if 1
|
#if 0
|
||||||
wolfSSL_Debugging_ON();
|
wolfSSL_Debugging_ON();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -396,7 +406,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PK_CALLBACKS
|
#ifdef HAVE_PK_CALLBACKS
|
||||||
/* register a sign callbacks for the long term key */
|
/* register sign callbacks for the long term key */
|
||||||
#ifdef HAVE_ECC
|
#ifdef HAVE_ECC
|
||||||
wolfSSL_CTX_SetEccSignCb(ctx, myEccSign);
|
wolfSSL_CTX_SetEccSignCb(ctx, myEccSign);
|
||||||
#endif
|
#endif
|
||||||
|
@ -406,9 +416,6 @@ int main(int argc, char** argv)
|
||||||
wolfSSL_CTX_SetRsaPssSignCb(ctx, myRsaPssSign);
|
wolfSSL_CTX_SetRsaPssSignCb(ctx, myRsaPssSign);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#else
|
|
||||||
printf("Warning: PK not compiled in! Please configure wolfSSL with "
|
|
||||||
" --enable-pkcallbacks and try again\n");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Load server certificates into WOLFSSL_CTX */
|
/* Load server certificates into WOLFSSL_CTX */
|
||||||
|
|
Loading…
Reference in New Issue