[Help-gnutls] Really I can not understand nothing of SSL...

Fran e_agf at yahoo.es
Mon Aug 8 13:39:54 CEST 2005


Hello,
Why certtool request for a int number for serial?, if I think that
should be >= unsigned long long (64 bit):


>  int size, serial, client;
> 
> serial = get_serial();
> 
> int get_serial(void)
> {
>     if (batch) {
>         if (cfg.serial < 0)
>             return 0;
>         return cfg.serial;
>     } else {
>         return
>             read_int("Enter the certificate's serial number (decimal): ");
>     }
> }
> 
>    serial = get_serial();
>     buffer[3] = serial & 0xff;
>     buffer[2] = (serial >> 8) & 0xff;
>     buffer[1] = (serial >> 16) & 0xff;
>     buffer[0] = 0;
> 
>     result = gnutls_x509_crt_set_serial(crt, buffer, 4);
>     if (result < 0) {
>         fprintf(stderr, "serial: %s\n", gnutls_strerror(result));
>         exit(1);
>     }
> 





More information about the Gnutls-help mailing list