True, but the result of "( anything | non-zero value)" will be a non-zero
value and a non-zero value evaluates to true, yes?.  If EVP_PKT_SIGN were
zero, then the statement would be equivalent to:

 if ((peer != NULL) && (type))

because a bitwise OR with 0 gives you what you started with.  As
EVP_PKT_SIGN is a known value and we're using it merely for true/false
instead of setting flags or even storing the result, it's either a poorly
constructed statement, or I'm demonstrating a gross misunderstanding of C's
bitwise operators or logical evaluation mechanisms.


On 7/24/07, Tim Rice <[EMAIL PROTECTED]> wrote:

On Tue, 24 Jul 2007, Ryan Smith wrote:

> Line 2250 of s3_srvr.c has the following conditional statement:
>
>     if ((peer != NULL) && (type | EVP_PKT_SIGN))
>
> As EVP_PKT_SIGN is non-zero, this boils down to:
>
>     if ((peer != NULL) && (TRUE))

But that is a bit wise OR not a logical OR.

>
> or just:
>
>      if (peer != NULL)
>
> Should the line be:
>
>     if ((peer != NULL) && (type & EVP_PKT_SIGN))
>
> or am I missing something?
>
>
> --Ryan Smith
>

--
Tim Rice                                Multitalents    (707) 887-1469
[EMAIL PROTECTED]


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to