relaycorp / cloud-gateway

Infrastructure as Code and configuration for all Awala-Internet Gateways run by Relaycorp
MIT License
1 stars 1 forks source link

Identity public key can't be exported #93

Closed gnarea closed 9 months ago

gnarea commented 11 months ago

Both the CogRPC server and the certificate rotator job are failing because PKI.js is trying to export a public key from a private key using the private key's parameters (instead of actually export()ing the private key to SPKI).

 GCPKeystoreError: Private key cannot be exported (requested format: jwk)
at .GcpKmsRsaPssProvider.onExportKey ( /opt/gw/node_modules/@relaycorp/awala-keystore-cloud/src/lib/gcp/GcpKmsRsaPssProvider.ts:36 )
at .GcpKmsRsaPssProvider.exportKey ( /opt/gw/node_modules/webcrypto-core/build/webcrypto-core.js:220 )
at .SubtleCrypto.exportKey ( /opt/gw/node_modules/webcrypto-core/build/webcrypto-core.js:1465 )
at .CryptoEngine.exportKey ( /opt/gw/node_modules/pkijs/build/index.js:5555 )
at .derSerializePublicKey ( /opt/gw/node_modules/@relaycorp/relaynet-core/src/lib/crypto/keys/serialisation.ts:17 )
at .getRSAPublicKeyFromPrivate ( /opt/gw/node_modules/@relaycorp/relaynet-core/src/lib/crypto/keys/generation.ts:55 )
at .InternetGatewayManager.get ( /opt/gw/node_modules/@relaycorp/relaynet-core/src/lib/nodes/managers/NodeManager.ts:46 )
at process.processTicksAndRejections ( node:internal/process/task_queues:95 )
at .InternetGatewayManager.getCurrent ( /opt/gw/src/node/InternetGatewayManager.ts:37 )
at .<anonymous> ( /opt/gw/src/queueWorkers/crcIncoming.ts:48 ) 

https://console.cloud.google.com/errors/detail/CMyRtJ_Opc7mHg?project=gw-frankfurt-4065

gnarea commented 9 months ago

Fixed in https://github.com/relaycorp/cloud-gateway/commit/90942a9e9ef6d1dbd32df3ab091d2a854094ee60