From: Robert Nelson Date: Fri, 30 Jun 2006 07:01:30 +0000 (+0000) Subject: Fix 64 bit build problems. X-Git-Tag: Release-7.0.0~7917 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=63b0844b46fa7f3e06d44e28e611508339cf0a89;p=bacula%2Fbacula Fix 64 bit build problems. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3096 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 363710d468..4aae85329e 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -490,7 +490,7 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) /* Terminate the signing digest and send it to the Storage daemon */ if (signing_digest) { SIGNATURE *sig; - size_t size = 0; + uint32_t size = 0; uint8_t *buf; if ((sig = crypto_sign_new()) == NULL) { @@ -545,7 +545,7 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) /* Terminate any digest and send it to Storage daemon and the Director */ if (digest) { uint8_t md[CRYPTO_DIGEST_MAX_SIZE]; - size_t size; + uint32_t size; size = sizeof(md); diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 630e80ce9c..df677adf7b 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -47,8 +47,8 @@ const bool have_libz = false; int verify_signature(JCR *jcr, SIGNATURE *sig); int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, - uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size); -bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size); + uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, uint32_t cipher_block_size); +bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, uint32_t cipher_block_size); #define RETRY 10 /* retry wait time */ @@ -95,7 +95,7 @@ void do_restore(JCR *jcr) SIGNATURE *sig = NULL; /* Cryptographic signature (if any) for file */ CRYPTO_SESSION *cs = NULL; /* Cryptographic session data (if any) for file */ CIPHER_CONTEXT *cipher_ctx = NULL; /* Cryptographic cipher context (if any) for file */ - size_t cipher_block_size = 0; /* Cryptographic algorithm block size for file */ + uint32_t cipher_block_size = 0; /* Cryptographic algorithm block size for file */ int flags = 0; /* Options for extract_data() */ int stat; ATTR *attr; @@ -735,7 +735,7 @@ int verify_signature(JCR *jcr, SIGNATURE *sig) * Return value is the number of bytes written, or -1 on errors. */ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, - uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size) + uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, uint32_t cipher_block_size) { int stat; char *wbuf; /* write buffer */ @@ -864,9 +864,9 @@ ok: * writing it to bfd. * Return value is true on success, false on failure. */ -bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size) +bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, uint32_t cipher_block_size) { - size_t decrypted_len; + uint32_t decrypted_len; /* Write out the remaining block and free the cipher context */ jcr->crypto_buf = check_pool_memory_size(jcr->crypto_buf, cipher_block_size); diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index c86da93e9f..bbb28d0ee5 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -232,7 +232,7 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) /* compute MD5 or SHA1 hash */ if (digest) { char md[CRYPTO_DIGEST_MAX_SIZE]; - size_t size; + uint32_t size; size = sizeof(md); diff --git a/bacula/src/lib/crypto.c b/bacula/src/lib/crypto.c index ed73c1962c..9b943d2bf7 100644 --- a/bacula/src/lib/crypto.c +++ b/bacula/src/lib/crypto.c @@ -875,7 +875,7 @@ err: * Returns: true on success, stores the encoded data in dest, and the size in length. * false on failure. */ -int crypto_sign_encode(SIGNATURE *sig, uint8_t *dest, size_t *length) +int crypto_sign_encode(SIGNATURE *sig, uint8_t *dest, uint32_t *length) { if (*length == 0) { *length = i2d_SignatureData(sig->sigData, NULL); @@ -895,7 +895,7 @@ int crypto_sign_encode(SIGNATURE *sig, uint8_t *dest, size_t *length) */ -SIGNATURE *crypto_sign_decode(const uint8_t *sigData, size_t length) +SIGNATURE *crypto_sign_decode(const uint8_t *sigData, uint32_t length) { SIGNATURE *sig; #if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) @@ -1102,7 +1102,7 @@ CRYPTO_SESSION *crypto_session_new (crypto_cipher_t cipher, alist *pubkeys) * Returns: true on success, stores the encoded data in dest, and the size in length. * false on failure. */ -bool crypto_session_encode(CRYPTO_SESSION *cs, uint8_t *dest, size_t *length) +bool crypto_session_encode(CRYPTO_SESSION *cs, uint8_t *dest, uint32_t *length) { if (*length == 0) { *length = i2d_CryptoData(cs->cryptoData, NULL); @@ -1122,7 +1122,7 @@ bool crypto_session_encode(CRYPTO_SESSION *cs, uint8_t *dest, size_t *length) * Returns: CRYPTO_ERROR_NONE and a pointer to a newly allocated CRYPTO_SESSION structure in *session on success. * A crypto_error_t value on failure. */ -crypto_error_t crypto_session_decode(const uint8_t *data, size_t length, alist *keypairs, CRYPTO_SESSION **session) +crypto_error_t crypto_session_decode(const uint8_t *data, uint32_t length, alist *keypairs, CRYPTO_SESSION **session) { CRYPTO_SESSION *cs; X509_KEYPAIR *keypair; @@ -1230,7 +1230,7 @@ void crypto_session_free (CRYPTO_SESSION *cs) * Returns: A pointer to a CIPHER_CONTEXT object on success. The cipher block size is returned in blocksize. * NULL on failure. */ -CIPHER_CONTEXT *crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, size_t *blocksize) +CIPHER_CONTEXT *crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, uint32_t *blocksize) { CIPHER_CONTEXT *cipher_ctx; const EVP_CIPHER *ec;