- /* And finally, decrypt the packet. */
- arcfour_decrypt(&state->arcfour_context, ibuf, isize, obuf);
+ /*
+ * Decrypt the first byte in order to check if it is
+ * a compressed or uncompressed protocol field.
+ */
+ arcfour_decrypt(&state->arcfour_context, ibuf, 1, obuf);
+
+ /*
+ * Do PFC decompression.
+ * This would be nicer if we were given the actual sk_buff
+ * instead of a char *.
+ */
+ if ((obuf[0] & 0x01) != 0) {
+ obuf[1] = obuf[0];
+ obuf[0] = 0;
+ obuf++;
+ osize++;
+ }
+
+ /* And finally, decrypt the rest of the packet. */
+ arcfour_decrypt(&state->arcfour_context, ibuf + 1, isize - 1, obuf + 1);