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.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/extra/yassl/src/yassl_error.cpp b/extra/yassl/src/yassl_error.cpp
index c2af39a2bdd..e55c10c68c0 100644
--- a/extra/yassl/src/yassl_error.cpp
+++ b/extra/yassl/src/yassl_error.cpp
@@ -11,8 +11,9 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ along with this program; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ MA 02110-1301 USA.
*/
@@ -30,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 {
@@ -58,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 ((int) error) {
+ switch (localError) {
// yaSSL proper errors
case range_error :
@@ -120,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);
@@ -129,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;
@@ -147,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;