127bfbee1SPeter Avalos /* 227bfbee1SPeter Avalos * Redistribution and use in source and binary forms, with or without 327bfbee1SPeter Avalos * modification, are permitted provided that: (1) source code 427bfbee1SPeter Avalos * distributions retain the above copyright notice and this paragraph 527bfbee1SPeter Avalos * in its entirety, and (2) distributions including binary code include 627bfbee1SPeter Avalos * the above copyright notice and this paragraph in its entirety in 727bfbee1SPeter Avalos * the documentation or other materials provided with the distribution. 827bfbee1SPeter Avalos * THIS SOFTWARE IS PROVIDED ``AS IS'' AND 927bfbee1SPeter Avalos * WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT 1027bfbee1SPeter Avalos * LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 1127bfbee1SPeter Avalos * FOR A PARTICULAR PURPOSE. 1227bfbee1SPeter Avalos * 1327bfbee1SPeter Avalos * Functions for signature and digest verification. 1427bfbee1SPeter Avalos * 15*411677aeSAaron LI * Original code by Hannes Gredler (hannes@gredler.at) 1627bfbee1SPeter Avalos */ 1727bfbee1SPeter Avalos 18*411677aeSAaron LI /* for netdissect_options */ 19*411677aeSAaron LI #include "netdissect.h" 2027bfbee1SPeter Avalos 2127bfbee1SPeter Avalos /* signature checking result codes */ 2227bfbee1SPeter Avalos #define SIGNATURE_VALID 0 2327bfbee1SPeter Avalos #define SIGNATURE_INVALID 1 24*411677aeSAaron LI #define CANT_ALLOCATE_COPY 2 25*411677aeSAaron LI #define CANT_CHECK_SIGNATURE 3 2627bfbee1SPeter Avalos 2727bfbee1SPeter Avalos extern const struct tok signature_check_values[]; 28*411677aeSAaron LI extern int signature_verify(netdissect_options *, const u_char *, u_int, 29*411677aeSAaron LI const u_char *, void (*)(void *), const void *); 30