[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnutls] Why not?
From: |
Fran |
Subject: |
[Help-gnutls] Why not? |
Date: |
Tue, 01 Nov 2005 21:24:03 +0100 |
In certool:
> /*
> buffer[3] = serial & 0xff;
> buffer[2] = (serial >> 8) & 0xff;
> buffer[1] = (serial >> 16) & 0xff;
> buffer[0] = 0;
> */
Why not?
> #ifdef _32bit /* Machine */
> #ifdef _32bit_serial
> typedef union Raw_Int
> {
> unsigned char str[sizeof(unsigned int)];
> unsigned int integer;
> }RAW_INT;
> #endif
> /* long int is same as unsigned int !??? */
> #ifdef _64bit_serial
> ...
> #endif
> #endif
>
>
>
> #ifdef _64bit
> #ifdef _128bit
> /* Only C99 */
> ...
> #endif
> #endif
>
And :
int
gnutls_x509_crt_set_int64_serial (crt, unsigned long long int integer)
{
RAW_INT a;
signed int ret;
a.integer = integer;
if ((ret = gnutls_x509_crt_set_serial (crt,a.str, sizeof(a.str))), ret < 0)
{
fprintf (stderr, "serial: %s\n", gnutls_strerror (ret));
/*exit (1);*/ return (gnutls_strerror (ret));
}
return ;
}
I think that can work.
Good thing or bad thing ?
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Help-gnutls] Why not?,
Fran <=