Commit 4cd66139 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

core: update_crypto: Ensure we don't overflow while shifting



(cherry picked from commit 984407ba32a0f3d4ed5dd69510b943003bb3bd63)
Signed-off-by: Hugo Beauzée-Luyssen's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 4df4378f
......@@ -63,7 +63,7 @@ static inline uint32_t scalar_number( const uint8_t *p, int header_len )
else if( header_len == 2 )
return( (p[0] << 8) + p[1] );
else if( header_len == 4 )
return( (p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3] );
return( ((uint32_t)p[0] << 24) + (p[1] << 16) + (p[2] << 8) + p[3] );
else
abort();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment