summaryrefslogtreecommitdiff
path: root/extra/yassl/src/yassl_error.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'extra/yassl/src/yassl_error.cpp')
-rw-r--r--extra/yassl/src/yassl_error.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index e167075b984..74735347841 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -31,6 +31,11 @@
#pragma warning(disable: 4996)
#endif
+#ifdef _MSC_VER
+ // 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy
+ #pragma warning(disable: 4996)
+#endif
+
namespace yaSSL {
@@ -59,8 +64,9 @@ void SetErrorString(unsigned long error, char* buffer)
{
using namespace TaoCrypt;
const int max = MAX_ERROR_SZ; // shorthand
+ int localError = error; // errors from a few enums
- switch (error) {
+ switch (localError) {
// yaSSL proper errors
case range_error :
@@ -121,7 +127,7 @@ void SetErrorString(unsigned long error, char* buffer)
case certificate_error :
strncpy(buffer, "unable to proccess cerificate", max);
- break;
+ break;
case privateKey_error :
strncpy(buffer, "unable to proccess private key, bad format", max);
@@ -130,7 +136,7 @@ void SetErrorString(unsigned long error, char* buffer)
case badVersion_error :
strncpy(buffer, "protocol version mismatch", max);
break;
-
+
case compress_error :
strncpy(buffer, "compression error", max);
break;
@@ -148,6 +154,10 @@ void SetErrorString(unsigned long error, char* buffer)
strncpy(buffer, "the read operation would block", max);
break;
+ case SSL_ERROR_WANT_WRITE :
+ strncpy(buffer, "the write operation would block", max);
+ break;
+
case CERTFICATE_ERROR :
strncpy(buffer, "Unable to verify certificate", max);
break;