]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
cscvs to tla changeset 132
authorJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:48:24 +0000 (23:48 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 31 May 2004 23:48:24 +0000 (23:48 +0000)
Author: noodles
Date: 2004/05/27 21:55:38
Add support for writing packets that are larger than 8k.

parsekey.c

index 4482d8bc008d07a20330366a050f34a7033dee10..0367e2d1a927dd0f71631e569f5d582b05c8c7eb 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Copyright 2002 Project Purple
  *
  *
  * Copyright 2002 Project Purple
  *
- * $Id: parsekey.c,v 1.19 2004/05/27 18:42:22 noodles Exp $
+ * $Id: parsekey.c,v 1.20 2004/05/27 21:55:38 noodles Exp $
  */
 
 #include <assert.h>
  */
 
 #include <assert.h>
@@ -334,6 +334,28 @@ int write_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
                                curchar = (packets->packet->length - 192) &
                                         0xFF;
                                putchar_func(ctx, 1, &curchar);
                                curchar = (packets->packet->length - 192) &
                                         0xFF;
                                putchar_func(ctx, 1, &curchar);
+                       } else if (packets->packet->length > 8382 &&
+                               packets->packet->length < 0xFFFFFFFF) {
+                               logthing(LOGTHING_DEBUG,
+                                       "Writing 5 byte length");
+                               curchar = 255;
+                               putchar_func(ctx, 1, &curchar);
+                               
+                               curchar = (packets->packet->length >> 24);
+                               curchar &= 0xFF;
+                               putchar_func(ctx, 1, &curchar);
+                               
+                               curchar = (packets->packet->length >> 16);
+                               curchar &= 0xFF;
+                               putchar_func(ctx, 1, &curchar);
+                               
+                               curchar = (packets->packet->length >> 8);
+                               curchar &= 0xFF;
+                               putchar_func(ctx, 1, &curchar);
+                               
+                               curchar = packets->packet->length;
+                               curchar &= 0xFF;
+                               putchar_func(ctx, 1, &curchar);
                        } else {
                                logthing(LOGTHING_ERROR,
                                        "Unsupported new format length.");
                        } else {
                                logthing(LOGTHING_ERROR,
                                        "Unsupported new format length.");