[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#633877: libengine-tpm-openssl: always outputs usage and exits on ARM architecture

Package: libengine-tpm-openssl
Version: 0.4.1+20071221-8
Severity: normal
Tags: upstream

The problem is that in main() the return value of getopt_long, which is an int,
gets assigned to the variable `c', which is declared as char. Apparently, on
ARM architectures `char' defaults to `unsigned char' which means that `c' cannot
hold a return value of -1 by getopt_long (it will be interpreted as 255). Thus,
the test condition for -1 in the while loop never evaluates to true and the
following switch statement will eventually execute the default case, which
outputs the usage message and exits.

To fix this, the datatype of `c' should be changed from char to int. Here's a

--- create_tpm_key.c.bak    2011-07-13 14:13:01.000000000 +0200
+++ create_tpm_key.c    2011-07-13 14:13:15.000000000 +0200
@@ -145,7 +145,8 @@ int main(int argc, char **argv)
    ASN1_OCTET_STRING *blob_str;
    unsigned char   *blob_asn1 = NULL;
    int     asn1_len;
-   char        *filename, c, *openssl_key = NULL;
+   char        *filename, *openssl_key = NULL;
+   int c;
    int     option_index, auth = 0, popup = 0, wrap = 0;
    UINT32      enc_scheme = TSS_ES_RSAESPKCSV15;
    UINT32      sig_scheme = TSS_SS_RSASSAPKCS1V15_DER;

-- System Information:
Debian Release: 6.0.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: armel (armv7l)

Kernel: Linux (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libengine-tpm-openssl depends on:
ii  libc6                   2.11.2-10        Embedded GNU C Library: Shared lib
ii  libssl0.9.8             0.9.8o-4squeeze1 SSL shared libraries
ii  libtspi-dev             0.3.5-2          open-source TCG Software Stack (de
ii  libtspi1                0.3.5-2          open-source TCG Software Stack (li

libengine-tpm-openssl recommends no packages.

libengine-tpm-openssl suggests no packages.

-- no debconf information

Reply to: