Skip to content

Commit

Permalink
SingleApplicationPrivate: Use MD5 on macOS for block server name
Browse files Browse the repository at this point in the history
Maximum key size on macOS is PSHMNAMLEN (31).

Fixes #178
  • Loading branch information
jonaski committed Oct 12, 2023
1 parent c6519b6 commit f6375b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions singleapplication_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ QString SingleApplicationPrivate::getUsername()

void SingleApplicationPrivate::genBlockServerName()
{
#ifdef Q_OS_MACOS
// Maximum key size on macOS is PSHMNAMLEN (31).
QCryptographicHash appData( QCryptographicHash::Md5 );
#else
QCryptographicHash appData( QCryptographicHash::Sha256 );
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
appData.addData( "SingleApplication", 17 );
#else
Expand Down

0 comments on commit f6375b1

Please sign in to comment.