Make memory management uniform: _everything_ now goes through the
[u/mdw/putty] / ssh.h
diff --git a/ssh.h b/ssh.h
index 331ff3b..725569c 100644 (file)
--- a/ssh.h
+++ b/ssh.h
@@ -1,5 +1,7 @@
 #include <string.h>
 
+#include "puttymem.h"
+
 /*
  * Useful thing.
  */
@@ -126,17 +128,27 @@ struct ssh_kex {
     char *name;
 };
 
-struct ssh_hostkey {
-    void (*setkey)(char *data, int len);
-    char *(*fmtkey)(void);
-    char *(*fingerprint)(void);
-    int (*verifysig)(char *sig, int siglen, char *data, int datalen);
+struct ssh_signkey {
+    void *(*newkey)(char *data, int len);
+    void (*freekey)(void *key);
+    char *(*fmtkey)(void *key);
+    char *(*fingerprint)(void *key);
+    int (*verifysig)(void *key, char *sig, int siglen,
+                    char *data, int datalen);
+    int (*sign)(void *key, char *sig, int siglen,
+               char *data, int datalen);
     char *name;
     char *keytype;                     /* for host key cache */
 };
 
 struct ssh_compress {
     char *name;
+    void (*compress_init)(void);
+    int (*compress)(unsigned char *block, int len,
+                   unsigned char **outblock, int *outlen);
+    void (*decompress_init)(void);
+    int (*decompress)(unsigned char *block, int len,
+                     unsigned char **outblock, int *outlen);
 };
 
 #ifndef MSCRYPTOAPI
@@ -197,3 +209,13 @@ int rsa_generate(struct RSAKey *key, struct RSAAux *aux, int bits,
                  progfn_t pfn, void *pfnparam);
 Bignum primegen(int bits, int modulus, int residue,
                 int phase, progfn_t pfn, void *pfnparam);
+
+/*
+ * zlib compression.
+ */
+void zlib_compress_init(void);
+void zlib_decompress_init(void);
+int zlib_compress_block(unsigned char *block, int len,
+                       unsigned char **outblock, int *outlen);
+int zlib_decompress_block(unsigned char *block, int len,
+                         unsigned char **outblock, int *outlen);