The hash should always be positive.
diff --git a/OpenSSL/crypto/x509.c b/OpenSSL/crypto/x509.c
index daae351..4c97525 100644
--- a/OpenSSL/crypto/x509.c
+++ b/OpenSSL/crypto/x509.c
@@ -599,7 +599,7 @@
     if (!PyArg_ParseTuple(args, ":subject_name_hash"))
         return NULL;
 
-    return PyLong_FromLong(X509_subject_name_hash(self->x509));
+    return PyLong_FromLongLong(X509_subject_name_hash(self->x509));
 }
 
 static char crypto_X509_digest_doc[] = "\n\
diff --git a/OpenSSL/test/test_crypto.py b/OpenSSL/test/test_crypto.py
index 2ea096b..02b77a7 100644
--- a/OpenSSL/test/test_crypto.py
+++ b/OpenSSL/test/test_crypto.py
@@ -1306,7 +1306,7 @@
         name.
         """
         cert = load_certificate(FILETYPE_PEM, self.pemData)
-        self.assertEquals(cert.subject_name_hash(), -944919422L)
+        self.assertEquals(cert.subject_name_hash(), 3350047874)