> [vineet.ku...@gmail.com - Wed Sep 09 08:12:07 2009]:
> 
> I noticed in GENERAL_NAME_print() code the following parsing code
which has
> a bug.
> 
> When my test certificate's subjectAltName has "IP Address: 2001::21"
> [expanded out v6 style of course], then the code below ends up printing
> “::21” instead of “2001::21”.
> 
> Note that when I use inet_ntop(AF_INET6, p, ....) it all works fine and I
> get "2001::21".
> 
> 
> 
>                case GEN_IPADD:
> 
>                p = gen->d.ip->data;
> 
>                if(gen->d.ip->length == 4)
> 
>                        BIO_snprintf(oline, sizeof oline,
> 
>                                     "%d.%d.%d.%d", p[0], p[1], p[2],
p[3]);
> 
> *            else if(gen->d.ip->length == 16)** -------> **IPv6*
> 
>                        {
> 
>                        oline[0] = 0;
> 
>                        for (i = 0; i < 8; i++)
> 
>                                {
> 
>                                BIO_snprintf(htmp, sizeof htmp,
> 
>                                            *"%X", p[0] << 8 | p[1]*);
> 
>                                p += 2;
> 
>                                strcat(oline, htmp);
> 
>                                if (i != 7)
> 
>                                       strcat(oline, ":");
> 
>                                }
> 
>                        }
> 
> 

I've not managed to reproduce this. I created a certificate with an IP
of 2001::21 and it was printed out fine (well in full with the
additional zeroes). Can you attach or send me a certificate where the
address is incorrectly printed out?

Steve.
-- 
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to