Project

General

Profile

Bug #11304

cmd-crypto: NULL pointer errors

Added by Toomas Soome 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with NULL pointer:

    In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                     from admin_cmds.c:27:
    admin_cmds.c: In function 'cmd_init':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'Tspi_TPM_TakeOwnership' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    admin_cmds.c:664:46: note: in expansion of macro 'NULL'
      ret = Tspi_TPM_TakeOwnership(hTPM, hKeySRK, NULL);
                                                  ^~~~
    In file included from admin_cmds.c:41:0:
    /usr/include/tss/tspi.h:322:10: note: expected 'TSS_HKEY {aka unsigned int}' but argument is of type 'void *'
     TSPICALL Tspi_TPM_TakeOwnership
              ^~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                     from admin_cmds.c:27:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'Tspi_TPM_TakeOwnership' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    admin_cmds.c:668:47: note: in expansion of macro 'NULL'
       ret = Tspi_TPM_TakeOwnership(hTPM, hKeySRK, NULL);
                                                   ^~~~
    In file included from admin_cmds.c:41:0:
    /usr/include/tss/tspi.h:322:10: note: expected 'TSS_HKEY {aka unsigned int}' but argument is of type 'void *'
     TSPICALL Tspi_TPM_TakeOwnership
              ^~~~~~~~~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/unistd.h:40:0,
                     from admin_cmds.c:27:
    admin_cmds.c: In function 'cmd_auth':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'Tspi_ChangeAuth' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    admin_cmds.c:704:30: note: in expansion of macro 'NULL'
      ret = Tspi_ChangeAuth(hTPM, NULL, hNewPolicy);
                                  ^~~~
    In file included from admin_cmds.c:41:0:
    /usr/include/tss/tspi.h:84:10: note: expected 'TSS_HOBJECT {aka unsigned int}' but argument is of type 'void *'
     TSPICALL Tspi_ChangeAuth
              ^~~~~~~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdlib_iso.h:50:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdlib.h:37,
                     from main.c:29:
    main.c: In function 'set_policy_options':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 3 of 'Tspi_SetAttribData' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    main.c:198:7: note: in expansion of macro 'NULL'
           NULL, len, unicode_prompt);
           ^~~~
    In file included from main.c:36:0:
    /usr/include/tss/tspi.h:66:10: note: expected 'TSS_FLAG {aka unsigned int}' but argument is of type 'void *'
     TSPICALL Tspi_SetAttribData
              ^~~~~~~~~~~~~~~~~~

    signcsr.c: In function 'build_cert_from_csr':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'kmf_set_cert_validity' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    signcsr.c:39:7: note: in definition of macro 'SET_VALUE'
      rv = f; \
           ^
    signcsr.c:130:46: note: in expansion of macro 'NULL'
      SET_VALUE(kmf_set_cert_validity(signedCert, NULL, ltime),
                                                  ^~~~
    In file included from common.h:44:0,
                     from signcsr.c:33:
    /code/illumos-gate/proto/root_i386/usr/include/kmfapi.h:216:19: note: expected 'time_t {aka long int}' but argument is of type 'void *'
     extern KMF_RETURN kmf_set_cert_validity(KMF_X509_CERTIFICATE *,
                       ^~~~~~~~~~~~~~~~~~~~~
    gencsr.c: In function 'gencsr_file':
    gencsr.c:229:13: error: comparison between pointer and integer [-Werror]
      if (kubits != NULL) {
                 ^~
    gencsr.c: In function 'gencsr_nss':
    gencsr.c:315:13: error: comparison between pointer and integer [-Werror]
      if (kubits != NULL) {
                 ^~

    gencert.c: In function 'gencert_pkcs11':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'kmf_set_cert_validity' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    gencert.c:37:11: note: in definition of macro 'SET_VALUE'
       kmfrv = f; \
               ^
    gencert.c:112:47: note: in expansion of macro 'NULL'
      SET_VALUE(kmf_set_cert_validity(&signedCert, NULL, ltime),
                                                   ^~~~
    In file included from common.h:44:0,
                     from gencert.c:32:
    /code/illumos-gate/proto/root_i386/usr/include/kmfapi.h:216:19: note: expected 'time_t {aka long int}' but argument is of type 'void *'
     extern KMF_RETURN kmf_set_cert_validity(KMF_X509_CERTIFICATE *,
                       ^~~~~~~~~~~~~~~~~~~~~
    gencert.c: In function 'gencert_file':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'kmf_set_cert_validity' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    gencert.c:37:11: note: in definition of macro 'SET_VALUE'
       kmfrv = f; \
               ^
    gencert.c:318:47: note: in expansion of macro 'NULL'
      SET_VALUE(kmf_set_cert_validity(&signedCert, NULL, ltime),
                                                   ^~~~
    In file included from common.h:44:0,
                     from gencert.c:32:
    /code/illumos-gate/proto/root_i386/usr/include/kmfapi.h:216:19: note: expected 'time_t {aka long int}' but argument is of type 'void *'
     extern KMF_RETURN kmf_set_cert_validity(KMF_X509_CERTIFICATE *,
                       ^~~~~~~~~~~~~~~~~~~~~
    gencert.c: In function 'gencert_nss':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 2 of 'kmf_set_cert_validity' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    gencert.c:37:11: note: in definition of macro 'SET_VALUE'
       kmfrv = f; \
               ^
    gencert.c:470:47: note: in expansion of macro 'NULL'
      SET_VALUE(kmf_set_cert_validity(&signedCert, NULL, ltime),
                                                   ^~~~
    In file included from common.h:44:0,
                     from gencert.c:32:
    /code/illumos-gate/proto/root_i386/usr/include/kmfapi.h:216:19: note: expected 'time_t {aka long int}' but argument is of type 'void *'
     extern KMF_RETURN kmf_set_cert_validity(KMF_X509_CERTIFICATE *,
                       ^~~~~~~~~~~~~~~~~~~~~

    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from setpin.c:34:
    setpin.c: In function 'setpin_pkcs11':
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 1 of 'final_pk11' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    setpin.c:157:15: note: in expansion of macro 'NULL'
        final_pk11(NULL);
                   ^~~~
    In file included from setpin.c:40:0:
    common.h:87:13: note: expected 'CK_SESSION_HANDLE {aka long unsigned int}' but argument is of type 'void *'
     extern void final_pk11(CK_SESSION_HANDLE sess);
                 ^~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from setpin.c:34:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 1 of 'final_pk11' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    setpin.c:167:15: note: in expansion of macro 'NULL'
        final_pk11(NULL);
                   ^~~~
    In file included from setpin.c:40:0:
    common.h:87:13: note: expected 'CK_SESSION_HANDLE {aka long unsigned int}' but argument is of type 'void *'
     extern void final_pk11(CK_SESSION_HANDLE sess);
                 ^~~~~~~~~~
    In file included from /code/illumos-gate/proto/root_i386/usr/include/iso/stdio_iso.h:53:0,
                     from /code/illumos-gate/proto/root_i386/usr/include/stdio.h:82,
                     from setpin.c:34:
    /code/illumos-gate/proto/root_i386/usr/include/sys/null.h:28:14: error: passing argument 1 of 'final_pk11' makes integer from pointer without a cast [-Werror=int-conversion]
     #define NULL ((void *)0)
                  ^
    setpin.c:183:14: note: in expansion of macro 'NULL'
       final_pk11(NULL);
                  ^~~~
    In file included from setpin.c:40:0:
    common.h:87:13: note: expected 'CK_SESSION_HANDLE {aka long unsigned int}' but argument is of type 'void *'
     extern void final_pk11(CK_SESSION_HANDLE sess);
                 ^~~~~~~~~~
    common.c: In function 'close_sess':
    common.c:188:11: error: comparison between pointer and integer [-Werror]
      if (sess == NULL) {
               ^~
    common.c: In function 'logout_token':
    common.c:210:11: error: comparison between pointer and integer [-Werror]
      if (sess == NULL) {
               ^~
    cc1: all warnings being treated as errors

History

#1

Updated by Electric Monk 3 months ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 6f2b04a2ce785423fe988216ae694366499884b2

commit  6f2b04a2ce785423fe988216ae694366499884b2
Author: Toomas Soome <tsoome@me.com>
Date:   2019-07-09T05:48:28.000Z

    11304 cmd-crypto: NULL pointer errors
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF