[glib-openssl] Propagate RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY as a GError



commit 6cdf59d0c3ee95c033be83442c37a097c2dc8b35
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Thu Oct 26 12:51:26 2017 +0200

    Propagate RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY as a GError

 tls/openssl/gtlsconnection-openssl.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index a5588e0..c3caec6 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -172,6 +172,14 @@ end_openssl_io (GTlsConnectionOpenssl  *openssl,
       return status;
     }
 
+  if (err_lib == ERR_LIB_RSA && reason == RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY)
+    {
+      g_clear_error (&my_error);
+      g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_BAD_CERTIFICATE,
+                           _("Digest too big for RSA key"));
+      return G_TLS_CONNECTION_BASE_ERROR;
+    }
+
   if (my_error != NULL)
     g_propagate_error (error, my_error);
   else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]