Re: [PATCH spice-common 2/2] test: Add a test for subject_to_x509_name function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Dec 18, 2018 at 12:19:28PM -0500, Frediano Ziglio wrote:
> > On Thu, Dec 13, 2018 at 02:20:25PM +0000, Frediano Ziglio wrote:
> > > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > > ---
> > >  common/ssl_verify.c     |   5 +-
> > >  common/ssl_verify.h     |   4 ++
> > >  tests/Makefile.am       |  20 ++++++
> > >  tests/test-ssl-verify.c | 141 ++++++++++++++++++++++++++++++++++++++++
> > >  4 files changed, 169 insertions(+), 1 deletion(-)
> > >  create mode 100644 tests/test-ssl-verify.c
> > > 
> > > diff --git a/common/ssl_verify.c b/common/ssl_verify.c
> > > index 74f95bb..3ccb52d 100644
> > > --- a/common/ssl_verify.c
> > > +++ b/common/ssl_verify.c
> > > @@ -278,7 +278,10 @@ static int verify_hostname(X509* cert, const char
> > > *hostname)
> > >      return cn_match;
> > >  }
> > >  
> > > -static X509_NAME* subject_to_x509_name(const char *subject, int *nentries)
> > > +#if !ENABLE_EXTRA_CHECKS
> > > +static
> > > +#endif
> > > +X509_NAME* subject_to_x509_name(const char *subject, int *nentries)
> > 
> > I'd prefer we don't go down that road...
> > 
> > Christophe
> > 
> 
> Any alternative suggestion?
> Adding the test at the end of the module?
> #Include the source module into the test program?
> 
> All are quite hacky but mocking/testing in C is often hacky.

#including "common/ssl_verify.c" sounds indeed like a better option, at
least the testing does not require changing the library code.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]