masterix21 / green-pass

PHP Green-Pass library
MIT License
37 stars 19 forks source link

🇮🇹 Bug greenpass tampone #4

Closed quellopiubello closed 2 years ago

quellopiubello commented 2 years ago

Buongiorno,

scansionando un greenpass ottenuto da tampone mi restituisce il seguente errore:

[Thu Dec 02 10:14:12.960644 2021] [php:error] [pid 21] [client 10.20.3.1:40038] PHP Fatal error:  Uncaught InvalidArgumentException: Out of range. Expected: 1, read: 0. in /var/www/html/vendor/spomky-labs/cbor-php/src/StringStream.php:53\nStack trace:\n#0 /var/www/html/vendor/spomky-labs/cbor-php/src/Decoder.php(48): CBOR\\StringStream->read()\n#1 /var/www/html/vendor/spomky-labs/cbor-php/src/Decoder.php(43): CBOR\\Decoder->process()\n#2 /var/www/html/vendor/masterix21/green-pass/src/Services/Decoder.php(58): CBOR\\Decoder->decode()\n#3 /var/www/html/vendor/masterix21/green-pass/src/Services/Decoder.php(74): Masterix21\\GreenPass\\Services\\Decoder::cose()\n#4 /var/www/html/test.php(14): Masterix21\\GreenPass\\Services\\Decoder::qrcode()\n#5 {main}\n  thrown in /var/www/html/vendor/spomky-labs/cbor-php/src/StringStream.php on line 53

Scansionando QR da vaccino sembra tutto ok. E' mai successo questo problema?

Grazie e saluti.

quellopiubello commented 2 years ago

Ciao, passando direttamente il valore del qr scansionato funziona. Il problema si presentava quando scansionavo il qr con una app e copiavo il valore dentro nel file di test di php. Probabilmente quando si copia viene modificato qualche carattere ed è per quello che viene restituito quell'errore.

masterix21 commented 2 years ago

Se utilizzavi un lettore di qrcode, probabilmente aggiungeva i caratteri newline (\n e/o \r).

Posso chiudere la issue?

quellopiubello commented 2 years ago

Si grazie e scusami il disturbo.

masterix21 commented 2 years ago

Grazie a te.