From 572a707765dc74bd781e26690cdf926adae015d2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 24 Jan 2013 19:42:40 +0100 Subject: [PATCH] Properly check MSB in openssl plugin's PKCS#7 implementation --- src/libstrongswan/plugins/openssl/openssl_pkcs7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c index 663397e59..ccc426235 100644 --- a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c +++ b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c @@ -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); }