mirror of
				https://git.kernel.org/pub/scm/network/wireless/iwd.git
				synced 2025-10-31 04:57:25 +01:00 
			
		
		
		
	dpp-util: fix dpp_point_from_asn1
This got merged without a few additional fixes, in particular an
over 80 character line and incorrect length check.
Fixes: d8116e8828b4 ("dpp-util: add dpp_point_from_asn1()")
			
			
This commit is contained in:
		
							parent
							
								
									b1c4a505b2
								
							
						
					
					
						commit
						06ec2a2e32
					
				| @ -828,7 +828,8 @@ struct l_ecc_point *dpp_point_from_asn1(const uint8_t *asn1, size_t len) | ||||
| 		return NULL; | ||||
| 
 | ||||
| 	/* SEQUENCE */ | ||||
| 	inner_seq = asn1_der_find_elem(outer_seq, outer_len, 0, &tag, &inner_len); | ||||
| 	inner_seq = asn1_der_find_elem(outer_seq, outer_len, 0, &tag, | ||||
| 					&inner_len); | ||||
| 	if (!inner_seq || tag != ASN1_ID_SEQUENCE) | ||||
| 		return NULL; | ||||
| 
 | ||||
| @ -859,7 +860,7 @@ struct l_ecc_point *dpp_point_from_asn1(const uint8_t *asn1, size_t len) | ||||
| 
 | ||||
| 	/* BITSTRING */ | ||||
| 	key_data = asn1_der_find_elem(outer_seq, outer_len, 1, &tag, &elen); | ||||
| 	if (!key_data || tag != ASN1_ID_BIT_STRING || elen > 2) | ||||
| 	if (!key_data || tag != ASN1_ID_BIT_STRING || elen < 2) | ||||
| 		return NULL; | ||||
| 
 | ||||
| 	return l_ecc_point_from_data(curve, key_data[1], | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 James Prestwood
						James Prestwood