Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: overflows _Ctype_long on linux x32 #81

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

ghaithsabba
Copy link

force go to use ulong on x32 ARCH

force go to use ulong on x32 ARCH
@ericchiang
Copy link
Collaborator

Tested this an it appears to still work on amd64. Did you actually test this an confirm it gives the right result on a 32 bit machine? E.g. did you run the following without a smartcard plugged in?

go test -v ./piv

@ghaithsabba
Copy link
Author

No but i test it with make test without smart card, and under 32 and arm, it worked without any proplem. i use this docker commands to build it
FROM i386/golang:1.15.2-buster
FROM arm32v7/golang:1.15.2-buster

@ericchiang
Copy link
Collaborator

So this may compile, but does it give the right result? I think you need a smart card and a x32 bit system to determine that. Can you paste the exact command you ran to test this? Did you run a pcscd and run the tests?

@ghaithsabba
Copy link
Author

So it's actually a part of other project which it works currently on arm 32x based system, I use it to sign and validate some text, and it works without any problem.
Unfortunately I don't have a smart card where I can run the whole test, as for the test I just run the test in the make file with
make test a lot of the tests were skipped because there isn't any smart card.

There is just one issue on Windows when I try to make more than one request to the YubiKey it tells me that the connection was rested, is this issue known for you?

@ghaithsabba
Copy link
Author

ghaithsabba commented Sep 25, 2020

i ran go test -v ./piv and got

=== RUN   TestYubiKeySignECDSA
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeySignECDSA (3.17s)
=== RUN   TestYubiKeyECDSASharedKey
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyECDSASharedKey (0.00s)
=== RUN   TestPINPrompt
=== RUN   TestPINPrompt/Never
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestPINPrompt/Once
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestPINPrompt/Always
    piv_test.go:99: no yubikeys detected, skipping
--- PASS: TestPINPrompt (0.00s)
    --- SKIP: TestPINPrompt/Never (0.00s)
    --- SKIP: TestPINPrompt/Once (0.00s)
    --- SKIP: TestPINPrompt/Always (0.00s)
=== RUN   TestSlots
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestSlots (0.00s)
=== RUN   TestYubiKeySignRSA
=== RUN   TestYubiKeySignRSA/rsa1024
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestYubiKeySignRSA/rsa2048
    piv_test.go:99: no yubikeys detected, skipping
--- PASS: TestYubiKeySignRSA (0.00s)
    --- SKIP: TestYubiKeySignRSA/rsa1024 (0.00s)
    --- SKIP: TestYubiKeySignRSA/rsa2048 (0.00s)
=== RUN   TestYubiKeyDecryptRSA
=== RUN   TestYubiKeyDecryptRSA/rsa1024
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestYubiKeyDecryptRSA/rsa2048
    piv_test.go:99: no yubikeys detected, skipping
--- PASS: TestYubiKeyDecryptRSA (0.00s)
    --- SKIP: TestYubiKeyDecryptRSA/rsa1024 (0.00s)
    --- SKIP: TestYubiKeyDecryptRSA/rsa2048 (0.00s)
=== RUN   TestYubiKeyAttestation
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyAttestation (0.00s)
=== RUN   TestYubiKeyStoreCertificate
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyStoreCertificate (0.00s)
=== RUN   TestYubiKeyGenerateKey
=== RUN   TestYubiKeyGenerateKey/ec_256
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestYubiKeyGenerateKey/ec_384
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestYubiKeyGenerateKey/rsa_1024
    piv_test.go:99: no yubikeys detected, skipping
=== RUN   TestYubiKeyGenerateKey/rsa_2048
    piv_test.go:99: no yubikeys detected, skipping
--- PASS: TestYubiKeyGenerateKey (0.00s)
    --- SKIP: TestYubiKeyGenerateKey/ec_256 (0.00s)
    --- SKIP: TestYubiKeyGenerateKey/ec_384 (0.00s)
    --- SKIP: TestYubiKeyGenerateKey/rsa_1024 (0.00s)
    --- SKIP: TestYubiKeyGenerateKey/rsa_2048 (0.00s)
=== RUN   TestYubiKeyPrivateKey
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyPrivateKey (0.00s)
=== RUN   TestYubiKeyPrivateKeyPINError
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyPrivateKeyPINError (0.00s)
=== RUN   TestRetiredKeyManagementSlot
=== RUN   TestRetiredKeyManagementSlot/Non-existent_slot,_before_range
=== RUN   TestRetiredKeyManagementSlot/Non-existent_slot,_after_range
=== RUN   TestRetiredKeyManagementSlot/First_retired_slot_key
=== RUN   TestRetiredKeyManagementSlot/Last_retired_slot_key
--- PASS: TestRetiredKeyManagementSlot (0.00s)
    --- PASS: TestRetiredKeyManagementSlot/Non-existent_slot,_before_range (0.00s)
    --- PASS: TestRetiredKeyManagementSlot/Non-existent_slot,_after_range (0.00s)
    --- PASS: TestRetiredKeyManagementSlot/First_retired_slot_key (0.00s)
    --- PASS: TestRetiredKeyManagementSlot/Last_retired_slot_key (0.00s)
=== RUN   TestContextClose
--- PASS: TestContextClose (0.00s)
=== RUN   TestContextListReaders
--- PASS: TestContextListReaders (0.00s)
=== RUN   TestHandle
    pcsc_test.go:64: could not find yubikey, skipping testing
--- SKIP: TestHandle (0.00s)
=== RUN   TestTransaction
    pcsc_test.go:64: could not find yubikey, skipping testing
--- SKIP: TestTransaction (0.00s)
=== RUN   TestErrors
--- PASS: TestErrors (0.00s)
=== RUN   TestGetVersion
    pcsc_test.go:64: could not find yubikey, skipping testing
--- SKIP: TestGetVersion (0.00s)
=== RUN   TestCards
--- PASS: TestCards (0.00s)
=== RUN   TestNewYubiKey
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestNewYubiKey (0.00s)
=== RUN   TestMultipleConnections
    piv_test.go:143: no yubikeys detected, skipping
--- SKIP: TestMultipleConnections (0.00s)
=== RUN   TestYubiKeySerial
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeySerial (0.00s)
=== RUN   TestYubiKeyLoginNeeded
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyLoginNeeded (0.00s)
=== RUN   TestYubiKeyPINRetries
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyPINRetries (0.00s)
=== RUN   TestYubiKeyReset
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyReset (0.00s)
=== RUN   TestYubiKeyLogin
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyLogin (0.00s)
=== RUN   TestYubiKeyAuthenticate
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyAuthenticate (0.00s)
=== RUN   TestYubiKeySetManagementKey
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeySetManagementKey (0.00s)
=== RUN   TestYubiKeyUnblockPIN
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyUnblockPIN (0.00s)
=== RUN   TestYubiKeyChangePIN
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyChangePIN (0.00s)
=== RUN   TestYubiKeyChangePUK
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestYubiKeyChangePUK (0.00s)
=== RUN   TestChangeManagementKey
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestChangeManagementKey (0.00s)
=== RUN   TestMetadata
    piv_test.go:99: no yubikeys detected, skipping
--- SKIP: TestMetadata (0.00s)
=== RUN   TestMetadataUnmarshal
--- PASS: TestMetadataUnmarshal (0.00s)
=== RUN   TestMetadataMarshal
--- PASS: TestMetadataMarshal (0.00s)
=== RUN   TestMetadataUpdate
--- PASS: TestMetadataUpdate (0.00s)
=== RUN   TestMetadataAdditoinalFields
--- PASS: TestMetadataAdditoinalFields (0.00s)
PASS
ok  	github.com/Ghaith0101/piv-go/piv	3.182s

Copy link
Collaborator

@ericchiang ericchiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! okay yeah I'll merge this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants