mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Improve order secret handling (#4139)
- use hmac.compare_digest for all secret comparisons - use salted_hmac with sha256 instead of plain sha1 for hashed secrets - move secret handling into helper functions
This commit is contained in:
@@ -19,7 +19,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
import hashlib
|
||||
import json
|
||||
import logging
|
||||
import urllib.parse
|
||||
@@ -1096,5 +1095,5 @@ class PaypalAPM(PaypalMethod):
|
||||
return eventreverse(self.event, 'plugins:paypal2:pay', kwargs={
|
||||
'order': payment.order.code,
|
||||
'payment': payment.pk,
|
||||
'hash': hashlib.sha1(payment.order.secret.lower().encode()).hexdigest(),
|
||||
'hash': payment.order.tagged_secret('plugins:paypal2:pay'),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user