Properly check MSB in openssl plugin's PKCS#7 implementation
authorTobias Brunner <tobias@strongswan.org>
Thu, 24 Jan 2013 18:42:40 +0000 (19:42 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 24 Jan 2013 22:36:02 +0000 (23:36 +0100)
src/libstrongswan/plugins/openssl/openssl_pkcs7.c

index 663397e..ccc4262 100644 (file)
@@ -615,7 +615,7 @@ static bool decrypt(private_openssl_pkcs7_t *this,
                                        continue;
                                }
                                chunk = openssl_asn1_str2chunk(sn);
-                               if (chunk.len && chunk.ptr[0] | 0x80)
+                               if (chunk.len && chunk.ptr[0] & 0x80)
                                {       /* if MSB is set, append a zero to make it non-negative */
                                        chunk = chunk_cata("cc", chunk_from_thing(zero), chunk);
                                }