alpine 3.6
crypto weakness #61


Weakness Breakdown


This weakness involves creating non-standard or non-tested algorithms, using weak algorithms or applying cryptographic algorithms incorrectly. Algorithms that were once considered safe are commonly later found to be unsafe, as the algorithms were broken.

Warning code(s):

The crypt functions use a poor one-way hashing algorithm; since they only accept passwords of 8 characters or fewer and only a two-byte salt, they are excessively vulnerable to dictionary attacks given today's faster computing equipment.

File Name:



The highlighted line of code below is the trigger point of this particular Alpine 3.6 crypto weakness.

 static int ft_pull_resp_cb(struct wpa_state_machine *sm, void *ctx)
	struct ft_r0kh_r1kh_resp_frame *frame = ctx;

	if (os_memcmp(frame->s1kh_id, sm->addr, ETH_ALEN) != 0)
		return 0;
	if (os_memcmp(frame->nonce, sm->ft_pending_pull_nonce,
		      FT_R0KH_R1KH_PULL_NONCE_LEN) != 0)
		return 0;
	if (sm->ft_pending_cb == NULL || sm->ft_pending_req_ies == NULL)
		return 0;

	wpa_printf(MSG_DEBUG, "FT: Response to a pending pull request for "
		   MACSTR " - process from timeout", MAC2STR(sm->addr));
	eloop_register_timeout(0, 0, ft_pull_resp_cb_finish, sm, NULL);
	return 1;

static int wpa_ft_rrb_rx_resp(struct wpa_authenticator *wpa_auth,
			      const u8 *src_addr,
			      const u8 *data, size_t data_len)
	struct ft_r0kh_r1kh_resp_frame f;
	const u8 *crypt;
	u8 *plain;
	struct ft_remote_r0kh *r0kh;
	int pairwise, res;

	wpa_printf(MSG_DEBUG, "FT: Received PMK-R1 pull response");

	if (data_len < sizeof(f))
		return -1;

	r0kh = wpa_auth->conf.r0kh_list;
	while (r0kh) {
		if (os_memcmp(r0kh->addr, src_addr, ETH_ALEN) == 0)
		r0kh = r0kh->next;
	if (r0kh == NULL) {
		wpa_printf(MSG_DEBUG, "FT: No matching R0KH address found for "
			   "PMK-R0 pull response source address " MACSTR,
		return -1;

	crypt = data + offsetof(struct ft_r0kh_r1kh_resp_frame, nonce);
	os_memset(&f, 0, sizeof(f));
	plain = ((u8 *) &f) + offsetof(struct ft_r0kh_r1kh_resp_frame, nonce); 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.