From: Tobias Brunner Date: Thu, 24 Jan 2013 18:42:40 +0000 (+0100) Subject: Properly check MSB in openssl plugin's PKCS#7 implementation X-Git-Tag: 5.0.2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=572a707765dc74bd781e26690cdf926adae015d2;p=thirdparty%2Fstrongswan.git Properly check MSB in openssl plugin's PKCS#7 implementation --- diff --git a/src/libstrongswan/plugins/openssl/openssl_pkcs7.c b/src/libstrongswan/plugins/openssl/openssl_pkcs7.c index 663397e596..ccc4262351 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); }