crypto: fix key handle extraction
I guess I don't need to say much about the commit itself. This causes the crash described in a comment in #25217, so it would be awesome if this could make it into 11.7.0 somehow, cc @BridgeAR.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines