Johnson is a capable backup but also a journeyman who has played for six teams in his eight NHL seasons.
He went 18-15-1 in 36 games for the Flames last season. Overall, he is 68-45-12 in 137 games, including 124 starts.
Johnson is familiar with Buffalo after spending the 2015-16 season with the Sabres, where he formed a close bond with starter Robin Lehner. He also stepped in and went 22-16-4 in a career-high 40 games started after Lehner was sidelined by a sprained ankle.
The Sabres addressed a depth need at goalie after prospect Cal Petersen elected to pursue free agency after opting out of his senior season at Notre Dame. Johnson will compete with Linus Ullmark for the backup job with the Sabres.
The Associated Press contributed to this report.