forked from CGM_Public/pretix_original
Device API: Fix RSA encryption crash (PRETIXEU-8Y2)
This commit is contained in:
@@ -89,6 +89,8 @@ class UpdateRequestSerializer(serializers.Serializer):
|
|||||||
|
|
||||||
class RSAEncryptedField(serializers.Field):
|
class RSAEncryptedField(serializers.Field):
|
||||||
def to_representation(self, value):
|
def to_representation(self, value):
|
||||||
|
if isinstance(value, memoryview):
|
||||||
|
value = value.tobytes()
|
||||||
public_key = load_pem_public_key(
|
public_key = load_pem_public_key(
|
||||||
self.context['device'].rsa_pubkey.encode(), Backend()
|
self.context['device'].rsa_pubkey.encode(), Backend()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user