811809
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
811809
index 009f157..a813a7c 100644
811809
--- a/src/lib/Makefile.in
811809
+++ b/src/lib/Makefile.in
811809
@@ -39,7 +39,7 @@ INCLUDE_FILES = ../baconfig.h ../bacula.h ../bc_types.h \
811809
 		fnmatch.h guid_to_name.h htable.h lex.h \
811809
 		lib.h md5.h mem_pool.h message.h mntent_cache.h \
811809
 		openssl.h plugins.h protos.h queue.h rblist.h \
811809
-		runscript.h rwlock.h serial.h sellist.h sha1.h \
811809
+		runscript.h rwlock.h serial.h sellist.h \
811809
 		smartall.h status.h tls.h tree.h var.h \
811809
 		waitq.h watchdog.h workq.h \
811809
 		parse_conf.h ini.h \
811809
@@ -55,7 +55,7 @@ LIBBAC_SRCS = attr.c base64.c berrno.c bsys.c binflate.c bget_msg.c \
811809
 	      guid_to_name.c hmac.c jcr.c lex.c alist.c dlist.c \
811809
 	      md5.c message.c mem_pool.c mntent_cache.c openssl.c \
811809
 	      plugins.c priv.c queue.c bregex.c \
811809
-	      rwlock.c scan.c sellist.c serial.c sha1.c \
811809
+	      rwlock.c scan.c sellist.c serial.c \
811809
 	      signal.c smartall.c rblist.c tls.c tree.c \
811809
 	      util.c var.c watchdog.c workq.c btimers.c \
811809
 	      address_conf.c breg.c htable.c lockmgr.c devlock.c
811809
@@ -193,13 +193,6 @@ md5sum: Makefile md5.o
811809
 	$(RMF) md5.o
811809
 	$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c
811809
 
811809
-sha1sum: Makefile sha1.o
811809
-	$(RMF) sha1.o
811809
-	$(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE)	$(CFLAGS) sha1.c
811809
-	$(LIBTOOL_LINK) $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(DLIB) -lbac -lm $(LIBS) $(OPENSSL_LIBS)
811809
-	$(RMF) sha1.o
811809
-	$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c
811809
-
811809
 bsnprintf: Makefile bsnprintf.o
811809
 	$(RMF) bsnprintf.o
811809
 	$(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE)  $(CFLAGS) bsnprintf.c
811809
@@ -250,7 +243,7 @@ libtool-clean:
811809
 
811809
 clean:	libtool-clean
811809
 	@$(RMF) core a.out *.o *.bak *.tex *.pdf *~ *.intpro *.extpro 1 2 3
811809
-	@$(RMF) rwlock_test md5sum sha1sum
811809
+	@$(RMF) rwlock_test md5sum
811809
 
811809
 realclean: clean
811809
 	@$(RMF) tags
811809
diff --git a/src/lib/lib.h b/src/lib/lib.h
811809
index b81f89f..c82dc29 100644
811809
--- a/src/lib/lib.h
811809
+++ b/src/lib/lib.h
811809
@@ -59,7 +59,6 @@
811809
 #include "fnmatch.h"
811809
 #endif
811809
 #include "md5.h"
811809
-#include "sha1.h"
811809
 #include "tree.h"
811809
 #include "watchdog.h"
811809
 #include "btimers.h"
811809
diff --git a/src/lib/sha1.c b/src/lib/sha1.c
811809
deleted file mode 100644
811809
index 7e58128..0000000
811809
--- a/src/lib/sha1.c
811809
+++ /dev/null
811809
@@ -1,510 +0,0 @@
811809
-/*
811809
- *  sha1.c
811809
- *
811809
- *  Description:
811809
- *      This file implements the Secure Hashing Algorithm 1 as
811809
- *      defined in FIPS PUB 180-1 published April 17, 1995.
811809
- *
811809
- *      The SHA-1, produces a 160-bit message digest for a given
811809
- *      data stream.  It should take about 2**n steps to find a
811809
- *      message with the same digest as a given message and
811809
- *      2**(n/2) to find any two messages with the same digest,
811809
- *      when n is the digest size in bits.  Therefore, this
811809
- *      algorithm can serve as a means of providing a
811809
- *      "fingerprint" for a message.
811809
- *
811809
- *  Portability Issues:
811809
- *      SHA-1 is defined in terms of 32-bit "words".  This code
811809
- *      uses <stdint.h> (included via "sha1.h" to define 32 and 8
811809
- *      bit unsigned integer types.  If your C compiler does not
811809
- *      support 32 bit unsigned integers, this code is not
811809
- *      appropriate.
811809
- *
811809
- *  Caveats:
811809
- *      SHA-1 is designed to work with messages less than 2^64 bits
811809
- *      long.  Although SHA-1 allows a message digest to be generated
811809
- *      for messages of any number of bits less than 2^64, this
811809
- *      implementation only works with messages with a length that is
811809
- *      a multiple of the size of an 8-bit character.
811809
- *
811809
- *  See sha1.h for copyright
811809
- */
811809
-
811809
-#include "sha1.h"
811809
-
811809
-/*
811809
- *  Define the SHA1 circular left shift macro
811809
- */
811809
-#define SHA1CircularShift(bits,word) \
811809
-                (((word) << (bits)) | ((word) >> (32-(bits))))
811809
-
811809
-/* Local Function Prototyptes */
811809
-static void SHA1PadMessage(SHA1Context *);
811809
-static void SHA1ProcessMessageBlock(SHA1Context *);
811809
-
811809
-/*
811809
- *  SHA1Init
811809
- *
811809
- *  Description:
811809
- *      This function will initialize the SHA1Context in preparation
811809
- *      for computing a new SHA1 message digest.
811809
- *
811809
- *  Parameters:
811809
- *      context: [in/out]
811809
- *          The context to reset.
811809
- *
811809
- *  Returns:
811809
- *      sha Error Code.
811809
- *
811809
- */
811809
-int SHA1Init(SHA1Context *context)
811809
-{
811809
-    if (!context)
811809
-    {
811809
-        return shaNull;
811809
-    }
811809
-
811809
-    context->Length_Low             = 0;
811809
-    context->Length_High            = 0;
811809
-    context->Message_Block_Index    = 0;
811809
-
811809
-    context->Intermediate_Hash[0]   = 0x67452301;
811809
-    context->Intermediate_Hash[1]   = 0xEFCDAB89;
811809
-    context->Intermediate_Hash[2]   = 0x98BADCFE;
811809
-    context->Intermediate_Hash[3]   = 0x10325476;
811809
-    context->Intermediate_Hash[4]   = 0xC3D2E1F0;
811809
-
811809
-    context->Computed   = 0;
811809
-    context->Corrupted  = 0;
811809
-
811809
-    return shaSuccess;
811809
-}
811809
-
811809
-/*
811809
- *  SHA1Final
811809
- *
811809
- *  Description:
811809
- *      This function will return the 160-bit message digest into the
811809
- *      Message_Digest array  provided by the caller.
811809
- *      NOTE: The first octet of hash is stored in the 0th element,
811809
- *            the last octet of hash in the 19th element.
811809
- *
811809
- *  Parameters:
811809
- *      context: [in/out]
811809
- *          The context to use to calculate the SHA-1 hash.
811809
- *      Message_Digest: [out]
811809
- *          Where the digest is returned.
811809
- *
811809
- *  Returns:
811809
- *      sha Error Code.
811809
- *
811809
- */
811809
-int SHA1Final(SHA1Context *context,
811809
-              uint8_t Message_Digest[SHA1HashSize])
811809
-{
811809
-    int i;
811809
-
811809
-    if (!context || !Message_Digest) {
811809
-        return shaNull;
811809
-    }
811809
-
811809
-    if (context->Corrupted) {
811809
-        return context->Corrupted;
811809
-    }
811809
-
811809
-    if (!context->Computed) {
811809
-        SHA1PadMessage(context);
811809
-        for(i=0; i<64; ++i) {
811809
-            /* message may be sensitive, clear it out */
811809
-            context->Message_Block[i] = 0;
811809
-        }
811809
-        context->Length_Low = 0;    /* and clear length */
811809
-        context->Length_High = 0;
811809
-        context->Computed = 1;
811809
-
811809
-    }
811809
-
811809
-    for(i = 0; i < SHA1HashSize; ++i) {
811809
-        Message_Digest[i] = context->Intermediate_Hash[i>>2]
811809
-                            >> 8 * ( 3 - ( i & 0x03 ) );
811809
-    }
811809
-
811809
-    return shaSuccess;
811809
-}
811809
-
811809
-/*
811809
- *  SHA1Update
811809
- *
811809
- *  Description:
811809
- *      This function accepts an array of octets as the next portion
811809
- *      of the message.
811809
- *
811809
- *  Parameters:
811809
- *      context: [in/out]
811809
- *          The SHA context to update
811809
- *      message_array: [in]
811809
- *          An array of characters representing the next portion of
811809
- *          the message.
811809
- *      length: [in]
811809
- *          The length of the message in message_array
811809
- *
811809
- *  Returns:
811809
- *      sha Error Code.
811809
- *
811809
- */
811809
-int SHA1Update(SHA1Context    *context,
811809
-               const uint8_t  *message_array,
811809
-               unsigned       length)
811809
-{
811809
-    if (!length) {
811809
-        return shaSuccess;
811809
-    }
811809
-
811809
-    if (!context || !message_array) {
811809
-        return shaNull;
811809
-    }
811809
-
811809
-    if (context->Computed) {
811809
-        context->Corrupted = shaStateError;
811809
-
811809
-        return shaStateError;
811809
-    }
811809
-
811809
-    if (context->Corrupted) {
811809
-         return context->Corrupted;
811809
-    }
811809
-    while(length-- && !context->Corrupted) {
811809
-       context->Message_Block[context->Message_Block_Index++] =
811809
-                    (*message_array & 0xFF);
811809
-
811809
-       context->Length_Low += 8;
811809
-       if (context->Length_Low == 0) {
811809
-           context->Length_High++;
811809
-           if (context->Length_High == 0) {
811809
-               /* Message is too long */
811809
-               context->Corrupted = 1;
811809
-           }
811809
-       }
811809
-
811809
-       if (context->Message_Block_Index == 64) {
811809
-           SHA1ProcessMessageBlock(context);
811809
-       }
811809
-
811809
-       message_array++;
811809
-    }
811809
-
811809
-    return shaSuccess;
811809
-}
811809
-
811809
-/*
811809
- *  SHA1ProcessMessageBlock
811809
- *
811809
- *  Description:
811809
- *      This function will process the next 512 bits of the message
811809
- *      stored in the Message_Block array.
811809
- *
811809
- *  Parameters:
811809
- *      None.
811809
- *
811809
- *  Returns:
811809
- *      Nothing.
811809
- *
811809
- *  Comments:
811809
-
811809
- *      Many of the variable names in this code, especially the
811809
- *      single character names, were used because those were the
811809
- *      names used in the publication.
811809
- *
811809
- *
811809
- */
811809
-static void SHA1ProcessMessageBlock(SHA1Context *context)
811809
-{
811809
-    const uint32_t K[] =    {       /* Constants defined in SHA-1   */
811809
-                            0x5A827999,
811809
-                            0x6ED9EBA1,
811809
-                            0x8F1BBCDC,
811809
-                            0xCA62C1D6
811809
-                            };
811809
-    int           t;                 /* Loop counter                */
811809
-    uint32_t      temp;              /* Temporary word value        */
811809
-    uint32_t      W[80];             /* Word sequence               */
811809
-    uint32_t      A, B, C, D, E;     /* Word buffers                */
811809
-
811809
-    /*
811809
-     *  Initialize the first 16 words in the array W
811809
-     */
811809
-    for(t = 0; t < 16; t++) {
811809
-        W[t] = context->Message_Block[t * 4] << 24;
811809
-        W[t] |= context->Message_Block[t * 4 + 1] << 16;
811809
-        W[t] |= context->Message_Block[t * 4 + 2] << 8;
811809
-        W[t] |= context->Message_Block[t * 4 + 3];
811809
-    }
811809
-
811809
-    for(t = 16; t < 80; t++) {
811809
-       W[t] = SHA1CircularShift(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
811809
-    }
811809
-
811809
-    A = context->Intermediate_Hash[0];
811809
-    B = context->Intermediate_Hash[1];
811809
-    C = context->Intermediate_Hash[2];
811809
-    D = context->Intermediate_Hash[3];
811809
-    E = context->Intermediate_Hash[4];
811809
-
811809
-    for(t = 0; t < 20; t++) {
811809
-        temp =  SHA1CircularShift(5,A) +
811809
-                ((B & C) | ((~B) & D)) + E + W[t] + K[0];
811809
-        E = D;
811809
-        D = C;
811809
-        C = SHA1CircularShift(30,B);
811809
-
811809
-        B = A;
811809
-        A = temp;
811809
-    }
811809
-
811809
-    for(t = 20; t < 40; t++) {
811809
-        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[1];
811809
-        E = D;
811809
-        D = C;
811809
-        C = SHA1CircularShift(30,B);
811809
-        B = A;
811809
-        A = temp;
811809
-    }
811809
-
811809
-    for(t = 40; t < 60; t++) {
811809
-        temp = SHA1CircularShift(5,A) +
811809
-               ((B & C) | (B & D) | (C & D)) + E + W[t] + K[2];
811809
-        E = D;
811809
-        D = C;
811809
-        C = SHA1CircularShift(30,B);
811809
-        B = A;
811809
-        A = temp;
811809
-    }
811809
-
811809
-    for(t = 60; t < 80; t++) {
811809
-        temp = SHA1CircularShift(5,A) + (B ^ C ^ D) + E + W[t] + K[3];
811809
-        E = D;
811809
-        D = C;
811809
-        C = SHA1CircularShift(30,B);
811809
-        B = A;
811809
-        A = temp;
811809
-    }
811809
-
811809
-    context->Intermediate_Hash[0] += A;
811809
-    context->Intermediate_Hash[1] += B;
811809
-    context->Intermediate_Hash[2] += C;
811809
-    context->Intermediate_Hash[3] += D;
811809
-    context->Intermediate_Hash[4] += E;
811809
-
811809
-    context->Message_Block_Index = 0;
811809
-}
811809
-
811809
-/*
811809
- *  SHA1PadMessage
811809
- *
811809
-
811809
- *  Description:
811809
- *      According to the standard, the message must be padded to an even
811809
- *      512 bits.  The first padding bit must be a '1'.  The last 64
811809
- *      bits represent the length of the original message.  All bits in
811809
- *      between should be 0.  This function will pad the message
811809
- *      according to those rules by filling the Message_Block array
811809
- *      accordingly.  It will also call the ProcessMessageBlock function
811809
- *      provided appropriately.  When it returns, it can be assumed that
811809
- *      the message digest has been computed.
811809
- *
811809
- *  Parameters:
811809
- *      context: [in/out]
811809
- *          The context to pad
811809
- *      ProcessMessageBlock: [in]
811809
- *          The appropriate SHA*ProcessMessageBlock function
811809
- *  Returns:
811809
- *      Nothing.
811809
- *
811809
- */
811809
-
811809
-static void SHA1PadMessage(SHA1Context *context)
811809
-{
811809
-    /*
811809
-     *  Check to see if the current message block is too small to hold
811809
-     *  the initial padding bits and length.  If so, we will pad the
811809
-     *  block, process it, and then continue padding into a second
811809
-     *  block.
811809
-     */
811809
-    if (context->Message_Block_Index > 55) {
811809
-        context->Message_Block[context->Message_Block_Index++] = 0x80;
811809
-        while(context->Message_Block_Index < 64) {
811809
-            context->Message_Block[context->Message_Block_Index++] = 0;
811809
-        }
811809
-
811809
-        SHA1ProcessMessageBlock(context);
811809
-
811809
-        while(context->Message_Block_Index < 56) {
811809
-            context->Message_Block[context->Message_Block_Index++] = 0;
811809
-        }
811809
-    } else {
811809
-        context->Message_Block[context->Message_Block_Index++] = 0x80;
811809
-        while(context->Message_Block_Index < 56) {
811809
-
811809
-            context->Message_Block[context->Message_Block_Index++] = 0;
811809
-        }
811809
-    }
811809
-
811809
-    /*
811809
-     *  Store the message length as the last 8 octets
811809
-     */
811809
-    context->Message_Block[56] = context->Length_High >> 24;
811809
-    context->Message_Block[57] = context->Length_High >> 16;
811809
-    context->Message_Block[58] = context->Length_High >> 8;
811809
-    context->Message_Block[59] = context->Length_High;
811809
-    context->Message_Block[60] = context->Length_Low >> 24;
811809
-    context->Message_Block[61] = context->Length_Low >> 16;
811809
-    context->Message_Block[62] = context->Length_Low >> 8;
811809
-    context->Message_Block[63] = context->Length_Low;
811809
-
811809
-    SHA1ProcessMessageBlock(context);
811809
-}
811809
-
811809
-#ifdef TEST_DRIVER
811809
-
811809
-/*
811809
- *  sha1test.c
811809
- *
811809
- *  Description:
811809
- *      This file will exercise the SHA-1 code performing the three
811809
- *      tests documented in FIPS PUB 180-1 plus one which calls
811809
- *      SHA1Input with an exact multiple of 512 bits, plus a few
811809
- *      error test checks.
811809
- *
811809
- *  Portability Issues:
811809
- *      None.
811809
- *
811809
- */
811809
-
811809
-#include <stdint.h>
811809
-#include <stdio.h>
811809
-#include <string.h>
811809
-#include "sha1.h"
811809
-
811809
-/*
811809
- *  Define patterns for testing
811809
- */
811809
-#define TEST1   "abc"
811809
-#define TEST2a  "abcdbcdecdefdefgefghfghighijhi"
811809
-
811809
-#define TEST2b  "jkijkljklmklmnlmnomnopnopq"
811809
-#define TEST2   TEST2a TEST2b
811809
-#define TEST3   "a"
811809
-#define TEST4a  "01234567012345670123456701234567"
811809
-#define TEST4b  "01234567012345670123456701234567"
811809
-    /* an exact multiple of 512 bits */
811809
-#define TEST4   TEST4a TEST4b
811809
-char *testarray[4] =
811809
-{
811809
-    TEST1,
811809
-    TEST2,
811809
-    TEST3,
811809
-    TEST4
811809
-};
811809
-long int repeatcount[4] = { 1, 1, 1000000, 10 };
811809
-char *resultarray[4] =
811809
-{
811809
-    "A9 99 3E 36 47 06 81 6A BA 3E 25 71 78 50 C2 6C 9C D0 D8 9D",
811809
-    "84 98 3E 44 1C 3B D2 6E BA AE 4A A1 F9 51 29 E5 E5 46 70 F1",
811809
-    "34 AA 97 3C D4 C4 DA A4 F6 1E EB 2B DB AD 27 31 65 34 01 6F",
811809
-    "DE A3 56 A2 CD DD 90 C7 A7 EC ED C5 EB B5 63 93 4F 46 04 52"
811809
-};
811809
-
811809
-int main()
811809
-{
811809
-    SHA1Context sha;
811809
-    int i, j, err;
811809
-    uint8_t Message_Digest[20];
811809
-
811809
-    /*
811809
-     *  Perform SHA-1 tests
811809
-     */
811809
-    for(j = 0; j < 4; ++j) {
811809
-        printf( "\nTest %d: %d, '%s'\n",
811809
-                j+1,
811809
-                repeatcount[j],
811809
-                testarray[j]);
811809
-
811809
-        err = SHA1Init(&sha);
811809
-        if (err) {
811809
-            fprintf(stderr, "SHA1Reset Error %d.\n", err );
811809
-            break;    /* out of for j loop */
811809
-        }
811809
-
811809
-        for(i = 0; i < repeatcount[j]; ++i) {
811809
-
811809
-            err = SHA1Input(&sha,
811809
-                  (const unsigned char *) testarray[j],
811809
-                  strlen(testarray[j]));
811809
-            if (err) {
811809
-                fprintf(stderr, "SHA1Input Error %d.\n", err );
811809
-                break;    /* out of for i loop */
811809
-            }
811809
-        }
811809
-
811809
-        err = SHA1Final(&sha, Message_Digest);
811809
-        if (err) {
811809
-            fprintf(stderr,
811809
-            "SHA1Result Error %d, could not compute message digest.\n",
811809
-            err );
811809
-        }
811809
-        else
811809
-        {
811809
-            printf("\t");
811809
-            for(i = 0; i < 20 ; ++i) {
811809
-                printf("%02X ", Message_Digest[i]);
811809
-            }
811809
-            printf("\n");
811809
-        }
811809
-        printf("Should match:\n");
811809
-        printf("\t%s\n", resultarray[j]);
811809
-    }
811809
-
811809
-    /* Test some error returns */
811809
-    err = SHA1Input(&sha,(const unsigned char *) testarray[1], 1);
811809
-    printf ("\nError %d. Should be %d.\n", err, shaStateError );
811809
-    err = SHA1Init(0);
811809
-    printf ("\nError %d. Should be %d.\n", err, shaNull );
811809
-    return 0;
811809
-}
811809
-
811809
-#endif /* TEST_DRIVER */
811809
-
811809
-#ifdef SHA1_SUM
811809
-/*
811809
- * Reads a single ASCII file and prints the HEX sha1 sum.
811809
- */
811809
-#include <stdio.h>
811809
-int main(int argc, char *argv[])
811809
-{
811809
-   FILE *fd;
811809
-   SHA1Context ctx;
811809
-   char buf[5000];
811809
-   char signature[25];
811809
-
811809
-   if (argc < 1) {
811809
-      printf("Must have filename\n");
811809
-      exit(1);
811809
-   }
811809
-   fd = fopen(argv[1], "rb");
811809
-   if (!fd) {
811809
-      berrno be;
811809
-      printf("Could not open %s: ERR=%s\n", argv[1], be.bstrerror(errno));
811809
-      exit(1);
811809
-   }
811809
-   SHA1Init(&ctx;;
811809
-   while (fgets(buf, sizeof(buf), fd)) {
811809
-      SHA1Update(&ctx, (unsigned char *)buf, strlen(buf));
811809
-   }
811809
-   SHA1Final(&ctx, (unsigned char *)signature);
811809
-   for (int i=0; i < 20; i++) {
811809
-      printf("%02x", signature[i]& 0xFF);
811809
-   }
811809
-   printf("  %s\n", argv[1]);
811809
-   fclose(fd);
811809
-}
811809
-#endif
811809
diff --git a/src/lib/sha1.h b/src/lib/sha1.h
811809
deleted file mode 100644
811809
index 437fe19..0000000
811809
--- a/src/lib/sha1.h
811809
+++ /dev/null
811809
@@ -1,107 +0,0 @@
811809
-/*
811809
- *  sha1.h
811809
- *
811809
- *  Description:
811809
- *      This is the header file for code which implements the Secure
811809
- *      Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
811809
- *      April 17, 1995.
811809
- *
811809
- *      Many of the variable names in this code, especially the
811809
- *      single character names, were used because those were the names
811809
- *      used in the publication.
811809
- *
811809
- *      Please read the file sha1.c for more information.
811809
- *
811809
- * Full Copyright Statement
811809
- *
811809
- *    Copyright (C) The Internet Society (2001).  All Rights Reserved.
811809
- *
811809
- *    This document and translations of it may be copied and furnished to
811809
- *    others, and derivative works that comment on or otherwise explain it
811809
- *    or assist in its implementation may be prepared, copied, published
811809
- *    and distributed, in whole or in part, without restriction of any
811809
- *    kind, provided that the above copyright notice and this paragraph are
811809
- *    included on all such copies and derivative works.  However, this
811809
- *    document itself may not be modified in any way, such as by removing
811809
- *    the copyright notice or references to the Internet Society or other
811809
- *    Internet organizations, except as needed for the purpose of
811809
- *    developing Internet standards in which case the procedures for
811809
- *    copyrights defined in the Internet Standards process must be
811809
- *    followed, or as required to translate it into languages other than
811809
- *    English.
811809
- *
811809
- *    The limited permissions granted above are perpetual and will not be
811809
- *    revoked by the Internet Society or its successors or assigns.
811809
- *
811809
- *    This document and the information contained herein is provided on an
811809
- *    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
811809
- *    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
811809
- *    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
811809
- *    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
811809
- *    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
811809
- *
811809
- * Acknowledgement
811809
- *
811809
- *    Funding for the RFC Editor function is currently provided by the
811809
- *    Internet Society.
811809
- *
811809
- */
811809
-
811809
-#ifndef _SHA1_H_
811809
-#define _SHA1_H_
811809
-
811809
-#include "bacula.h"
811809
-
811809
-/*
811809
- * If you do not have the ISO standard stdint.h header file, then you
811809
- * must typdef the following:
811809
- *    name              meaning
811809
- *  uint32_t         unsigned 32 bit integer
811809
- *  uint8_t          unsigned 8 bit integer (i.e., unsigned char)
811809
- *  int32_t          integer of 32 bits
811809
- *
811809
- */
811809
-
811809
-#ifndef _SHA_enum_
811809
-#define _SHA_enum_
811809
-enum
811809
-{
811809
-    shaSuccess = 0,
811809
-    shaNull,            /* Null pointer parameter */
811809
-    shaInputTooLong,    /* input data too long */
811809
-    shaStateError       /* called Input after Result */
811809
-};
811809
-#endif
811809
-#define SHA1HashSize 20
811809
-
811809
-/*
811809
- *  This structure will hold context information for the SHA-1
811809
- *  hashing operation
811809
- */
811809
-typedef struct SHA1Context
811809
-{
811809
-    uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest  */
811809
-
811809
-    uint32_t Length_Low;            /* Message length in bits      */
811809
-    uint32_t Length_High;           /* Message length in bits      */
811809
-
811809
-			       /* Index into message block array   */
811809
-    int32_t Message_Block_Index;
811809
-    uint8_t Message_Block[64];      /* 512-bit message blocks      */
811809
-
811809
-    int Computed;               /* Is the digest computed?         */
811809
-    int Corrupted;             /* Is the message digest corrupted? */
811809
-} SHA1Context;
811809
-
811809
-/*
811809
- *  Function Prototypes
811809
- */
811809
-
811809
-int SHA1Init(SHA1Context *);
811809
-int SHA1Update(SHA1Context *,
811809
-	       const uint8_t *,
811809
-	       unsigned int);
811809
-int SHA1Final(SHA1Context *,
811809
-	       uint8_t Message_Digest[SHA1HashSize]);
811809
-
811809
-#endif