Bad return code in cert/write.c:

View: New views
2 Messages — Rating Filter:   Alert me  

Bad return code in cert/write.c:

by Scott Neugroschl-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe that there's an error with a bad return code in the file
write.c, function preEncodeCertificate

In the tests from lines 535 through 586 in cert/write.c:

When checking the validity of a certificate that we're creating, if
there's something wrong with it,
the routine is returning a misleading error of CRYPT_ERROR_NOTINITED.
This error is incorrect, as the
error can occur after the library has been properly initialized.  I
believe the correct error here
should be CRYPTLIB_ERROR_INVALID.

----
Scott Neugroschl
XYPRO Technologies
scott_n@...
805-583-2874 x121


_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.

Re: Bad return code in cert/write.c:

by Peter Gutmann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"Scott Neugroschl" <scott_n@...> writes:

>I believe that there's an error with a bad return code in the file
>write.c, function preEncodeCertificate
>
>In the tests from lines 535 through 586 in cert/write.c:
>
>When checking the validity of a certificate that we're creating, if
>there's something wrong with it,
>the routine is returning a misleading error of CRYPT_ERROR_NOTINITED.
>This error is incorrect, as the
>error can occur after the library has been properly initialized.  I
>believe the correct error here
>should be CRYPTLIB_ERROR_INVALID.

Only the return code on line 544 should be CRYPT_ERROR_INVALID, for all of the
other cases the situation is that some portion of the certificate such as the
serial number hasn't been initialised.  In those cases the correct error code
is CRYPT_ERROR_NOTINITED.

Peter.

_______________________________________________
Cryptlib mailing list
Cryptlib@... via Mail: cryptlib-request@...
Archive: ftp://ftp.franken.de/pub/crypt/cryptlib/archives/
http://news.gmane.org/gmane.comp.encryption.cryptlib
Posts from non-subscribed addresses are blocked to prevent spam, please
subscribe in order to post messages.