mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05:00 
			
		
		
		
	Fix off-by-one error in ecdsa_write_signature()
Made some signature fail with 521-bit curve
This commit is contained in:
		
							parent
							
								
									e09d2f8261
								
							
						
					
					
						commit
						c75c56fef7
					
				@ -220,8 +220,8 @@ int ecdsa_write_signature( ecdsa_context *ctx,
 | 
				
			|||||||
                           void *p_rng )
 | 
					                           void *p_rng )
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int ret;
 | 
					    int ret;
 | 
				
			||||||
    unsigned char buf[MAX_SIG_LEN];
 | 
					    unsigned char buf[MAX_SIG_LEN + 3];
 | 
				
			||||||
    unsigned char *p = buf + MAX_SIG_LEN - 1;
 | 
					    unsigned char *p = buf + MAX_SIG_LEN;
 | 
				
			||||||
    size_t len = 0;
 | 
					    size_t len = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if( ( ret = ecdsa_sign( &ctx->grp, &ctx->r, &ctx->s, &ctx->d,
 | 
					    if( ( ret = ecdsa_sign( &ctx->grp, &ctx->r, &ctx->s, &ctx->d,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user