Fix the GENERALIZEDTIME case of _get_boundary_time
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 7a0bb9c..aac622c 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -517,10 +517,12 @@
             if generalized_timestamp[0] == _api.NULL:
                 1/0
             else:
-                string_timestamp = _api.string(
-                    _api.cast("char*", generalized_timestamp[0].data))
+                string_timestamp = _api.cast(
+                    "ASN1_STRING*", generalized_timestamp[0])
+                string_data = _api.ASN1_STRING_data(string_timestamp)
+                string_result = _api.string(string_data)
                 _api.ASN1_GENERALIZEDTIME_free(generalized_timestamp[0])
-                return string_timestamp
+                return string_result
 
 
     def get_notBefore(self):