If HAVE_LIBCRYPTO isn't defined, define a stub signature_verify().

That cleans up its callers.
This commit is contained in:
Guy Harris 2015-12-27 18:09:33 -08:00
parent c995065620
commit 7b1cba646d
3 changed files with 11 additions and 25 deletions

View File

@ -2667,13 +2667,9 @@ isis_print(netdissect_options *ndo,
if (tlv_len != ISIS_SUBTLV_AUTH_MD5_LEN+1)
ND_PRINT((ndo, ", (invalid subTLV) "));
#ifdef HAVE_LIBCRYPTO
sigcheck = signature_verify(ndo, optr, length, tptr + 1,
isis_clear_checksum_lifetime,
header_lsp);
#else
sigcheck = CANT_CHECK_SIGNATURE;
#endif
ND_PRINT((ndo, " (%s)", tok2str(signature_check_values, "Unknown", sigcheck)));
break;

View File

@ -654,21 +654,9 @@ rsvp_clear_checksum(void *header)
static int
rsvp_obj_print(netdissect_options *ndo,
const u_char *pptr
#ifndef HAVE_LIBCRYPTO
_U_
#endif
, u_int plen
#ifndef HAVE_LIBCRYPTO
_U_
#endif
, const u_char *tptr,
const char *ident, u_int tlen,
const struct rsvp_common_header *rsvp_com_header
#ifndef HAVE_LIBCRYPTO
_U_
#endif
)
const u_char *pptr, u_int plen, const u_char *tptr,
const char *ident, u_int tlen,
const struct rsvp_common_header *rsvp_com_header)
{
const struct rsvp_object_header *rsvp_obj_header;
const u_char *obj_tptr;
@ -1682,14 +1670,10 @@ _U_
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest+8),
EXTRACT_32BITS(obj_ptr.rsvp_obj_integrity->digest + 12)));
#ifdef HAVE_LIBCRYPTO
sigcheck = signature_verify(ndo, pptr, plen,
obj_ptr.rsvp_obj_integrity->digest,
rsvp_clear_checksum,
rsvp_com_header);
#else
sigcheck = CANT_CHECK_SIGNATURE;
#endif
ND_PRINT((ndo, " (%s)", tok2str(signature_check_values, "Unknown", sigcheck)));
obj_tlen+=sizeof(struct rsvp_obj_integrity_t);

View File

@ -109,9 +109,7 @@ signature_compute_hmac_md5(const uint8_t *text, int text_len, unsigned char *key
MD5_Final(digest, &context); /* finish up 2nd pass */
}
USES_APPLE_RST
#endif
#ifdef HAVE_LIBCRYPTO
/*
* Verify a cryptographic signature of the packet.
* Currently only MD5 is supported.
@ -198,6 +196,14 @@ signature_verify(netdissect_options *ndo, const u_char *pptr, u_int plen,
return (SIGNATURE_INVALID);
}
}
#else
int
signature_verify(netdissect_options *ndo _U_, const u_char *pptr _U_,
u_int plen _U_, const u_char *sig_ptr _U_,
void (*clear_rtn)(void *) _U_, const void *clear_arg _U_)
{
return (CANT_CHECK_SIGNATURE);
}
#endif
/*