Update access.dm

This commit is contained in:
Timothy Teakettle
2021-09-16 15:30:39 +01:00
parent 6e30018618
commit d1dd46238a
@@ -14,10 +14,16 @@
"on read" = IC_PINTYPE_PULSE_OUT
)
var/cipherkey
/obj/item/integrated_circuit/input/card_reader/Initialize()
cipherkey = uppertext(random_string(2000+rand(0,10), GLOB.alphabet)) // the same way SScircuit.cipherkey is generated
..()
/obj/item/integrated_circuit/input/card_reader/attackby_react(obj/item/I, mob/living/user, intent)
var/obj/item/card/id/card = I.GetID()
var/list/access = I.GetAccess()
var/passkey = strtohex(XorEncrypt(json_encode(access), SScircuit.cipherkey))
var/passkey = strtohex(XorEncrypt(json_encode(access), cipherkey))
if(assembly)
assembly.access_card.access |= access
@@ -38,3 +44,6 @@
push_data()
activate_pin(1)
return TRUE
/obj/item/integrated_circuit/input/card_reader/set_pin_data(pin_type, pin_number, datum/new_data)
cipherkey = uppertext(random_string(2000+rand(0,10), GLOB.alphabet)) // NEVER REUSE THE SAME KEY