Merge pull request #353 from alex/check-result-code

check the result here
diff --git a/OpenSSL/crypto.py b/OpenSSL/crypto.py
index 9ff2e70..74ebc24 100644
--- a/OpenSSL/crypto.py
+++ b/OpenSSL/crypto.py
@@ -1615,10 +1615,10 @@
             "type argument must be FILETYPE_PEM, FILETYPE_ASN1, or "
             "FILETYPE_TEXT")
 
+    assert result_code == 1
     return _bio_to_string(bio)
 
 
-
 def dump_privatekey(type, pkey, cipher=None, passphrase=None):
     """
     Dump a private key to a buffer