]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
make example more compact by removing error checking.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 26 May 2010 21:58:35 +0000 (23:58 +0200)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Thu, 3 Jun 2010 17:54:56 +0000 (19:54 +0200)
doc/cha-cert-auth.texi

index 89b53c6686c4f2e0dd65011740ae3758cc2a7b17..68999e1d80efc47ba12a490510a708b7cc0fee88 100644 (file)
@@ -376,8 +376,8 @@ URLs as described in @code{draft-pechanec-pkcs11uri-01}. For example a public
 key on a smart card may be referenced as:
 
 @example
-pkcs11:token=Nikos;serial=307521161601031;model=PKCS%2315;manufacturer=EnterSafe;\
-object=test1;objecttype=public;\
+pkcs11:token=Nikos;serial=307521161601031;model=PKCS%2315; \
+manufacturer=EnterSafe;object=test1;objecttype=public;\
 id=32:f1:53:f3:e3:79:90:b0:86:24:14:10:77:ca:5d:ec:2d:15:fa:ed
 @end example
 
@@ -458,29 +458,20 @@ int i;
        if (ret < 0 && ret != GNUTLS_E_SHORT_MEMORY_BUFFER)
                exit(1);
 
+       /* no error checking from now on */
        obj_list = malloc(sizeof(*obj_list)*obj_list_size);
-       if (obj_list == NULL)
-               exit(1);
 
-       ret = gnutls_pkcs11_obj_list_import_url( obj_list, &obj_list_size, url, flags);
-       if (ret < 0)
-               exit(1);
+       gnutls_pkcs11_obj_list_import_url( obj_list, &obj_list_size, url, flags);
 
        /* now all certificates are in obj_list */
 
        for (i=0;i<obj_list_size;i++) {
 
-               ret = gnutls_x509_crt_init(&xcrt);
-               if (ret < 0)
-                       exit(1);
+               gnutls_x509_crt_init(&xcrt);
                
-               ret = gnutls_x509_crt_import_pkcs11(xcrt, obj_list[i]);
-               if (ret < 0)
-                       exit(1);
+               gnutls_x509_crt_import_pkcs11(xcrt, obj_list[i]);
                
-               ret = gnutls_x509_crt_print (xcrt, GNUTLS_CRT_PRINT_FULL, &cinfo);
-               if (ret < 0)
-                       exit(1);
+               gnutls_x509_crt_print (xcrt, GNUTLS_CRT_PRINT_FULL, &cinfo);
 
                fprintf(stdout, "cert[%d]:\n %s\n\n", cinfo.data);