[pkg-opensc-commit] [pkcs11-helper] 69/253: 64bit fixups
Eric Dorland
eric at moszumanska.debian.org
Fri Jan 6 23:39:05 UTC 2017
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository pkcs11-helper.
commit 6915cd02bab2a4d12b4d55180d0c17ebcdde0437
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date: Sat Jan 27 18:27:27 2007 +0000
64bit fixups
---
config-w32-vc.h.in | 3 +++
configure.ac | 6 ++++++
lib/pkcs11h-certificate.c | 32 ++++++++++++++++----------------
lib/pkcs11h-data.c | 6 +++---
lib/pkcs11h-openssl.c | 5 +++--
lib/pkcs11h-serialization.c | 8 ++++----
lib/pkcs11h-session.c | 2 +-
7 files changed, 36 insertions(+), 26 deletions(-)
diff --git a/config-w32-vc.h.in b/config-w32-vc.h.in
index f448777..3cb5609 100644
--- a/config-w32-vc.h.in
+++ b/config-w32-vc.h.in
@@ -162,6 +162,9 @@
/* Version number of package */
#define VERSION "@VERSION@"
+/* size_t printf format */
+#define P_Z "%u"
+
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
diff --git a/configure.ac b/configure.ac
index 8875cb4..376e055 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,6 +348,12 @@ if test \
PKCS11H_FEATURES="${PKCS11H_FEATURES} engine_crypto"
fi
+if test "${WIN32}" = "yes"; then
+ AC_DEFINE([P_Z], ["%u"], [size_t printf format])
+else
+ AC_DEFINE([P_Z], ["%zu"], [size_t printf format])
+fi
+
mydocdir="\$(docdir)-\$(PACKAGE_VERSION)"
myhtmldir="\$(htmldir)-\$(PACKAGE_VERSION)"
pkgconfigdir="\$(libdir)/pkgconfig"
diff --git a/lib/pkcs11h-certificate.c b/lib/pkcs11h-certificate.c
index de60d1f..975af83 100644
--- a/lib/pkcs11h-certificate.c
+++ b/lib/pkcs11h-certificate.c
@@ -121,7 +121,7 @@ _pkcs11h_certificate_isBetterCertificate (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: _pkcs11h_certificate_isBetterCertificate entry current=%p, current_size=%u, newone=%p, newone_size=%u",
+ "PKCS#11: _pkcs11h_certificate_isBetterCertificate entry current=%p, current_size="P_Z", newone=%p, newone_size="P_Z"",
current,
current_size,
newone,
@@ -819,7 +819,7 @@ __pkcs11h_certificate_doPrivateOperation (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: __pkcs11h_certificate_doPrivateOperation entry certificate=%p, op=%d, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: __pkcs11h_certificate_doPrivateOperation entry certificate=%p, op=%d, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
op,
mech_type,
@@ -1040,7 +1040,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: __pkcs11h_certificate_doPrivateOperation return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: __pkcs11h_certificate_doPrivateOperation return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1312,7 +1312,7 @@ pkcs11h_certificate_sign (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_sign entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_sign entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1345,7 +1345,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_sign return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_sign return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1374,7 +1374,7 @@ pkcs11h_certificate_signRecover (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_signRecover entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_signRecover entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1407,7 +1407,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_signRecover return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_signRecover return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1436,7 +1436,7 @@ pkcs11h_certificate_decrypt (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_decrypt entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_decrypt entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1469,7 +1469,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_decrypt return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_decrypt return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1498,7 +1498,7 @@ pkcs11h_certificate_unwrap (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_unwrap entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_unwrap entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1531,7 +1531,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_unwrap return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_unwrap return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1561,7 +1561,7 @@ pkcs11h_certificate_signAny (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_signAny entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_signAny entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1646,7 +1646,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_signAny return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_signAny return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1676,7 +1676,7 @@ pkcs11h_certificate_decryptAny (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_decryptAny entry certificate=%p, mech_type=%ld, source=%p, source_size=%u, target=%p, *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_decryptAny entry certificate=%p, mech_type=%ld, source=%p, source_size="P_Z", target=%p, *p_target_size="P_Z"",
(void *)certificate,
mech_type,
source,
@@ -1760,7 +1760,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_decryptAny return rv=%lu-'%s', *p_target_size=%u",
+ "PKCS#11: pkcs11h_certificate_decryptAny return rv=%lu-'%s', *p_target_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_target_size
@@ -1996,7 +1996,7 @@ pkcs11h_certificate_getCertificateBlob (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_getCertificateBlob entry certificate=%p, certificate_blob=%p, *p_certificate_blob_size=%u",
+ "PKCS#11: pkcs11h_certificate_getCertificateBlob entry certificate=%p, certificate_blob=%p, *p_certificate_blob_size="P_Z"",
(void *)certificate,
certificate_blob,
certificate_blob != NULL ? *p_certificate_blob_size : 0
diff --git a/lib/pkcs11h-data.c b/lib/pkcs11h-data.c
index 038b23d..8982021 100644
--- a/lib/pkcs11h-data.c
+++ b/lib/pkcs11h-data.c
@@ -167,7 +167,7 @@ pkcs11h_data_get (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_data_get entry token_id=%p, application='%s', label='%s', user_data=%p, mask_prompt=%08x, blob=%p, *p_blob_size=%u",
+ "PKCS#11: pkcs11h_data_get entry token_id=%p, application='%s', label='%s', user_data=%p, mask_prompt=%08x, blob=%p, *p_blob_size="P_Z"",
(void *)token_id,
application,
label,
@@ -280,7 +280,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_data_get return rv=%lu-'%s', *p_blob_size=%u",
+ "PKCS#11: pkcs11h_data_get return rv=%lu-'%s', *p_blob_size="P_Z"",
rv,
pkcs11h_getMessage (rv),
*p_blob_size
@@ -333,7 +333,7 @@ pkcs11h_data_put (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_data_put entry token_id=%p, application='%s', label='%s', user_data=%p, mask_prompt=%08x, blob=%p, blob_size=%u",
+ "PKCS#11: pkcs11h_data_put entry token_id=%p, application='%s', label='%s', user_data=%p, mask_prompt=%08x, blob=%p, blob_size="P_Z"",
(void *)token_id,
application,
label,
diff --git a/lib/pkcs11h-openssl.c b/lib/pkcs11h-openssl.c
index 8bc75d0..4e05b18 100644
--- a/lib/pkcs11h-openssl.c
+++ b/lib/pkcs11h-openssl.c
@@ -295,6 +295,7 @@ __pkcs11h_openssl_sign (
CK_RV rv = CKR_FUNCTION_FAILED;
int myrsa_size = 0;
+ size_t size_temp;
unsigned char *enc_alloc = NULL;
unsigned char *enc = NULL;
@@ -306,7 +307,7 @@ __pkcs11h_openssl_sign (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: __pkcs11h_openssl_sign entered - type=%d, m=%p, m_len=%u, signret=%p, *signlen=%u, rsa=%p",
+ "PKCS#11: __pkcs11h_openssl_sign entered - type=%d, m=%p, m_len=%u, signret=%p, *siglen=%u, rsa=%p",
type,
m,
m_len,
@@ -393,7 +394,7 @@ __pkcs11h_openssl_sign (
enc,
enc_len,
sigret,
- siglen
+ &size_temp
)) != CKR_OK
) {
_PKCS11H_LOG (PKCS11H_LOG_WARN, "PKCS#11: Cannot perform signature %ld:'%s'", rv, pkcs11h_getMessage (rv));
diff --git a/lib/pkcs11h-serialization.c b/lib/pkcs11h-serialization.c
index 591c591..0548b0f 100644
--- a/lib/pkcs11h-serialization.c
+++ b/lib/pkcs11h-serialization.c
@@ -86,7 +86,7 @@ pkcs11h_token_serializeTokenId (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_token_serializeTokenId entry sz=%p, *max=%u, token_id=%p",
+ "PKCS#11: pkcs11h_token_serializeTokenId entry sz=%p, *max="P_Z", token_id=%p",
sz,
sz != NULL ? *max : 0,
(void *)token_id
@@ -140,7 +140,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_token_serializeTokenId return rv=%lu-'%s', *max=%u, sz='%s'",
+ "PKCS#11: pkcs11h_token_serializeTokenId return rv=%lu-'%s', *max="P_Z", sz='%s'",
rv,
pkcs11h_getMessage (rv),
*max,
@@ -305,7 +305,7 @@ pkcs11h_certificate_serializeCertificateId (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_serializeCertificateId entry sz=%p, *max=%u, certificate_id=%p",
+ "PKCS#11: pkcs11h_certificate_serializeCertificateId entry sz=%p, *max="P_Z", certificate_id=%p",
sz,
sz != NULL ? *max : 0,
(void *)certificate_id
@@ -350,7 +350,7 @@ cleanup:
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: pkcs11h_certificate_serializeCertificateId return rv=%lu-'%s', *max=%u, sz='%s'",
+ "PKCS#11: pkcs11h_certificate_serializeCertificateId return rv=%lu-'%s', *max="P_Z", sz='%s'",
rv,
pkcs11h_getMessage (rv),
*max,
diff --git a/lib/pkcs11h-session.c b/lib/pkcs11h-session.c
index 350d144..fe6f6ff 100644
--- a/lib/pkcs11h-session.c
+++ b/lib/pkcs11h-session.c
@@ -783,7 +783,7 @@ _pkcs11h_session_getObjectById (
_PKCS11H_DEBUG (
PKCS11H_LOG_DEBUG2,
- "PKCS#11: _pkcs11h_session_getObjectById entry session=%p, class=%ld, id=%p, id_size=%u, p_handle=%p",
+ "PKCS#11: _pkcs11h_session_getObjectById entry session=%p, class=%ld, id=%p, id_size="P_Z", p_handle=%p",
(void *)session,
class,
id,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/pkcs11-helper.git
More information about the pkg-opensc-commit
mailing list