]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix 64 bit build problems.
authorRobert Nelson <robertn@the-nelsons.org>
Fri, 30 Jun 2006 07:01:30 +0000 (07:01 +0000)
committerRobert Nelson <robertn@the-nelsons.org>
Fri, 30 Jun 2006 07:01:30 +0000 (07:01 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3096 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/backup.c
bacula/src/filed/restore.c
bacula/src/filed/verify.c
bacula/src/lib/crypto.c

index 363710d468c37ff9f70894d83fd41c75358479c1..4aae85329ef434b2b8b222a6d8fd43c552eb2cf9 100644 (file)
@@ -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);
 
index 630e80ce9ca287361d927cbd0c83fab6078f8f8e..df677adf7be07e44f3d40182d04f68a529bd6a5d 100644 (file)
@@ -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);
index c86da93e9f2af5063eea0e3291d8588a11ac972f..bbb28d0ee5c3022eeb4c4a812fbca01402cbc1be 100644 (file)
@@ -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);
          
index ed73c1962c243159b16df512ec0e46ea2ba9d9fd..9b943d2bf78d68649283e2828f021dc4c20f172d 100644 (file)
@@ -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;