[Help-gnutls] Re: Why not?

Fran e_agf at yahoo.es
Sun Nov 6 17:07:55 CET 2005


Nobody reply me, well.

pkcs12 bag are incorrect generated without any error, while I'm trying
to solve the problem I see this in certtool (1.2.8) (line 2510):

>  if (result < 0) {
>             fprintf(stderr, "bag_set_data: %s\n", gnutls_strerror(result));
>             exit(1);
>         }
> 
>         index = result;
> 
>         result = gnutls_pkcs12_bag_set_friendly_name(kbag, index, name);
>         if (result < 0) {
>             fprintf(stderr, "bag_set_friendly_name: %s\n",
>                     gnutls_strerror(result));
>             exit(1);
>         }
> 
>         size = sizeof(_key_id);
>         result = gnutls_x509_privkey_get_key_id(key, 0, _key_id, &size);
>         if (result < 0) {
>             fprintf(stderr, "key_id: %s\n", gnutls_strerror(result));
>             exit(1);
>         }
> 
>         key_id.data = _key_id;
>         key_id.size = size;
> 
> >>>>>>>>>>>>>>>>>>>>>/*      result = gnutls_pkcs12_bag_set_key_id(kbag, result , &key_id);*/<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>   result = gnutls_pkcs12_bag_set_key_id(kbag, index , &key_id);
> 
>         if (result < 0) {
>             fprintf(stderr, "bag_ gnutls_x509_privkey_get_key_id gnutls_x509_privkey_get_key_idset_key_id: %s\n",
>                     gnutls_strerror(result));
>             exit(1);
>         }


> man gnutls_x509_privkey_get_key_id
> RETURN VALUE
>        In case of failure a negative value will be returned, and 0 on success.


> man   gnutls_pkcs12_bag_set_key_id
>  int gnutls_pkcs12_bag_set_key_id(gnutls_pkcs12_bag_t bag, int indx, const gnutls_datum_t * id);


man gnutls_pkcs12_bag_set_data
> DESCRIPTION
>        This function will insert the given data of the given type into the bag.
> 
>        Returns the index of the added bag on success, or a negative value on error.

Incompatible class of object in assignment or bad definition.
I think that should be "index" and not "result".








More information about the Gnutls-help mailing list