svn commit: r338749 - head/sys/netinet

Rodney W. Grimes freebsd at pdx.rh.CN85.dnsmgr.net
Tue Sep 18 15:32:04 UTC 2018


> Author: tuexen
> Date: Tue Sep 18 10:53:07 2018
> New Revision: 338749
> URL: https://svnweb.freebsd.org/changeset/base/338749
> 
> Log:
>   Remove unused code.

This type of commit log entry is almost useless
when someone is reading a svn log.  In the future
could you please indicate what was removed, ie:
Log:
    Removed unused sctp_verify_hmac function.

Thanks,
Rod
>   
>   Approved by:	re (kib@)
>   MFC after:	1 week
> 
> Modified:
>   head/sys/netinet/sctp_auth.c
>   head/sys/netinet/sctp_auth.h
> 
> Modified: head/sys/netinet/sctp_auth.c
> ==============================================================================
> --- head/sys/netinet/sctp_auth.c	Tue Sep 18 07:29:01 2018	(r338748)
> +++ head/sys/netinet/sctp_auth.c	Tue Sep 18 10:53:07 2018	(r338749)
> @@ -1060,40 +1060,6 @@ sctp_hmac_m(uint16_t hmac_algo, uint8_t *key, uint32_t
>  	return (digestlen);
>  }
>  
> -/*-
> - * verify the HMAC digest using the desired hash key, text, and HMAC
> - * algorithm.
> - * Returns -1 on error, 0 on success.
> - */
> -int
> -sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
> -    uint8_t *text, uint32_t textlen,
> -    uint8_t *digest, uint32_t digestlen)
> -{
> -	uint32_t len;
> -	uint8_t temp[SCTP_AUTH_DIGEST_LEN_MAX];
> -
> -	/* sanity check the material and length */
> -	if ((key == NULL) || (keylen == 0) ||
> -	    (text == NULL) || (textlen == 0) || (digest == NULL)) {
> -		/* can't do HMAC with empty key or text or digest */
> -		return (-1);
> -	}
> -	len = sctp_get_hmac_digest_len(hmac_algo);
> -	if ((len == 0) || (digestlen != len))
> -		return (-1);
> -
> -	/* compute the expected hash */
> -	if (sctp_hmac(hmac_algo, key, keylen, text, textlen, temp) != len)
> -		return (-1);
> -
> -	if (memcmp(digest, temp, digestlen) != 0)
> -		return (-1);
> -	else
> -		return (0);
> -}
> -
> -
>  /*
>   * computes the requested HMAC using a key struct (which may be modified if
>   * the keylen exceeds the HMAC block len).
> 
> Modified: head/sys/netinet/sctp_auth.h
> ==============================================================================
> --- head/sys/netinet/sctp_auth.h	Tue Sep 18 07:29:01 2018	(r338748)
> +++ head/sys/netinet/sctp_auth.h	Tue Sep 18 10:53:07 2018	(r338749)
> @@ -178,9 +178,6 @@ extern uint32_t sctp_get_hmac_digest_len(uint16_t hmac
>  extern uint32_t
>  sctp_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
>      uint8_t *text, uint32_t textlen, uint8_t *digest);
> -extern int
> -sctp_verify_hmac(uint16_t hmac_algo, uint8_t *key, uint32_t keylen,
> -    uint8_t *text, uint32_t textlen, uint8_t *digest, uint32_t digestlen);
>  extern uint32_t
>  sctp_compute_hmac(uint16_t hmac_algo, sctp_key_t *key,
>      uint8_t *text, uint32_t textlen, uint8_t *digest);
> 
> 

-- 
Rod Grimes                                                 rgrimes at freebsd.org


More information about the svn-src-head mailing list