Skip to content

Commit

Permalink
Merge pull request #180 from jonaski/blockservername_macos
Browse files Browse the repository at this point in the history
SingleApplicationPrivate: Use MD5 on macOS for block server name
  • Loading branch information
itay-grudev authored Oct 12, 2023
2 parents c6519b6 + 7332ec4 commit 8c48163
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 3.5.1

* Bug Fix: Maximum QNativeIpcKey key size on macOS. - _Jonas Kvinge_

## 3.5.0

* Switch to the new QNativeIpcKey based QSharedMemory constructor with Qt 6.6 and higher. - _Jonas Kvinge_
Expand Down
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 8c48163

Please sign in to comment.