On Fri, Feb 06, 2009 at 06:31:58PM +0100, Luk Claes wrote: > Kurt Roeckx wrote: > > On Fri, Feb 06, 2009 at 05:33:52PM +0100, Luk Claes wrote: > >> tags 513542 + patch > >> --- > >> root-system-5.18.00.orig/xrootd/src/xrootd/src/XrdCrypto/XrdCryptosslX509Req.cc > >> +++ > >> root-system-5.18.00/xrootd/src/xrootd/src/XrdCrypto/XrdCryptosslX509Req.cc > >> @@ -307,5 +307,5 @@ > >> return 0; > >> > >> // Ok: we can verify > >> - return X509_REQ_verify(creq,X509_REQ_get_pubkey(creq)); > >> + return X509_REQ_verify(creq,X509_REQ_get_pubkey(creq)) == -1 ? false : > >> X509_REQ_verify(creq,X509_REQ_get_pubkey(creq)); > >> } > > > > Why don't you just do: > > return X509_REQ_verify(creq,X509_REQ_get_pubkey(creq)) > 0; > > Because I'm not sure about the conventions regarding true/false 0/1, so > 1 is supposed to be true?
true is 1, false is 0. If X509_REQ_verify returns 1, it was succesful, and the function wants to return true in that case. X509_REQ_verify returns -1 or 0 on failure and you want to return false. So either a == 1, or > 0 check would be good. Kurt -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org