]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/crypto.h
Fix a memory leak.
[bacula/bacula] / bacula / src / lib / crypto.h
index d9cafe794e7d7747173f48454ee9f5e54b84c519..f681f349c9165354033b71970cbe419f2a8da12a 100644 (file)
@@ -19,7 +19,7 @@
  * license please contact Landon Fuller <landonf@opendarwin.org>.
  */
 /*
-   Copyright (C) 2005 Kern Sibbald
+   Copyright (C) 2006 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -46,7 +46,7 @@ typedef struct Digest DIGEST;
 typedef struct Signature SIGNATURE;
 
 /* Opaque PKI Symmetric Key Data Structure */
-typedef struct Crypto_Recipients CRYPTO_RECIPIENTS;
+typedef struct Crypto_Session CRYPTO_SESSION;
 
 /* PEM Decryption Passphrase Callback */
 typedef int (CRYPTO_PEM_PASSWD_CB) (char *buf, int size, const void *userdata);
@@ -74,9 +74,12 @@ typedef enum {
 typedef enum {
    CRYPTO_ERROR_NONE           = 0, /* No error */
    CRYPTO_ERROR_NOSIGNER       = 1, /* Signer not found */
-   CRYPTO_ERROR_INVALID_DIGEST = 2, /* Unsupported digest algorithm */
-   CRYPTO_ERROR_BAD_SIGNATURE  = 3, /* Signature is invalid */
-   CRYPTO_ERROR_INTERNAL       = 4  /* Internal Error */
+   CRYPTO_ERROR_NORECIPIENT    = 2, /* Recipient not found */
+   CRYPTO_ERROR_INVALID_DIGEST = 3, /* Unsupported digest algorithm */
+   CRYPTO_ERROR_INVALID_CRYPTO = 4, /* Unsupported encryption algorithm */
+   CRYPTO_ERROR_BAD_SIGNATURE  = 5, /* Signature is invalid */
+   CRYPTO_ERROR_DECRYPTION     = 6, /* Decryption error */
+   CRYPTO_ERROR_INTERNAL       = 7  /* Internal Error */
 } crypto_error_t;
 
 /* Message Digest Sizes */
@@ -97,8 +100,8 @@ typedef enum {
  * This must be kept in sync with the available message digest algorithms.
  * Just in case someone forgets, I've added assertions
  * to crypto_digest_finalize().
- *     MD5: 128 bits
- *     SHA-1: 160 bits
+ *      MD5: 128 bits
+ *      SHA-1: 160 bits
  */
 #ifndef HAVE_SHA2
 #define CRYPTO_DIGEST_MAX_SIZE CRYPTO_DIGEST_SHA1_SIZE