mirror of
				https://github.com/yuzu-emu/mbedtls.git
				synced 2025-11-04 02:14:52 +00:00 
			
		
		
		
	pk_wrap.c: fix length mismatch check placement
This commit is contained in:
		
							parent
							
								
									96cc1b3def
								
							
						
					
					
						commit
						266d907c87
					
				| 
						 | 
					@ -605,12 +605,6 @@ static int ecdsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
 | 
				
			||||||
        goto cleanup;
 | 
					        goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( p != sig + sig_len )
 | 
					 | 
				
			||||||
    {
 | 
					 | 
				
			||||||
        ret = MBEDTLS_ERR_PK_SIG_LEN_MISMATCH;
 | 
					 | 
				
			||||||
        goto cleanup;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    if( psa_asymmetric_verify( key_slot, psa_sig_md,
 | 
					    if( psa_asymmetric_verify( key_slot, psa_sig_md,
 | 
				
			||||||
                               hash, hash_len,
 | 
					                               hash, hash_len,
 | 
				
			||||||
                               buf, 2 * signature_part_size )
 | 
					                               buf, 2 * signature_part_size )
 | 
				
			||||||
| 
						 | 
					@ -619,6 +613,12 @@ static int ecdsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
 | 
				
			||||||
         ret = MBEDTLS_ERR_ECP_VERIFY_FAILED;
 | 
					         ret = MBEDTLS_ERR_ECP_VERIFY_FAILED;
 | 
				
			||||||
         goto cleanup;
 | 
					         goto cleanup;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if( p != sig + sig_len )
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        ret = MBEDTLS_ERR_PK_SIG_LEN_MISMATCH;
 | 
				
			||||||
 | 
					        goto cleanup;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    ret = 0;
 | 
					    ret = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cleanup:
 | 
					cleanup:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue