/*---------------------------------------------------------------------------* Project: Horizon File: ssl_ConnectionIpc.h Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Rev: 28664 $ *---------------------------------------------------------------------------*/ // // このファイルを編集しないでください。 // このファイルは自動生成されます。 // #ifndef NN_SSL___SSL_CONNECTIONIPC_H_ #define NN_SSL___SSL_CONNECTIONIPC_H_ #include #include #include #include #include #include namespace nn { namespace ssl { class ConnectionIpc { public: enum Tag { TAG_IPC_ERROR, TAG_INITIALIZE_GENERAL_SESSION = 0x0001, TAG_NEW_CLIENT = 0x0002, TAG_CREATE_CERT_STORE = 0x0003, TAG_DESTROY_CERT_STORE = 0x0004, TAG_ADD_CERT_TO_CERT_STORE = 0x0005, TAG_ADD_INTERNAL_CERT_TO_CERT_STORE = 0x0006, TAG_REMOVE_CERT_FROM_CERT_STORE = 0x0007, TAG_CREATE_CRL_STORE = 0x0008, TAG_DESTROY_CRL_STORE = 0x0009, TAG_ADD_CRL_TO_CRL_STORE = 0x000a, TAG_ADD_INTERNAL_CRL_TO_CRL_STORE = 0x000b, TAG_REMOVE_CRL_FROM_CRL_STORE = 0x000c, TAG_CREATE_CLIENT_CERT = 0x000d, TAG_CREATE_INTERNAL_CLIENT_CERT = 0x000e, TAG_DESTROY_CLIENT_CERT = 0x000f, TAG_GATHER_RANDOM_ENTROPY = 0x0010, TAG_GENERATE_RANDOM_BYTES = 0x0011, TAG_INITIALIZE_CONNECTION_SESSION = 0x0012, TAG_DO_HANDSHAKE = 0x0013, TAG_DO_HANDSHAKE_WITH_GET_SERVER_CERT_INFO = 0x0014, TAG_READ = 0x0015, TAG_PEEK = 0x0016, TAG_WRITE = 0x0017, TAG_SET_SERVER_CERT_STORE = 0x0018, TAG_SET_CLIENT_CERT = 0x0019, TAG_SET_CRL_STORE = 0x001a, TAG_DISABLE_VERIFY_OPTION_FOR_DEBUG = 0x001b, TAG_GET_CIPHER_INFO = 0x001c, TAG_GET_CERT_VERIFY_ERRORS = 0x001d, TAG_SHUTDOWN = 0x001e, TAG_SET_SERVER_CERT_BUFFER = 0x001f, TAG_ADD_EV_POLICY_ID = 0x0020, TAG_IPC_END }; private: Handle m_Session; public: ConnectionIpc(Handle session) : m_Session(session) {} public: nn::Result InitializeGeneralSession(); nn::Result NewClient( s32 socket, u32 verifyOpt, const char8 pServerPath[], size_t serverPathSize, ConnectionHandle* handleCourier ); nn::Result CreateCertStore( CertStoreId* pCertId ); nn::Result DestroyCertStore( CertStoreId certId ); nn::Result AddCertToCertStore( CertStoreId certStoreId, const u8 pCertData[], size_t certDataSize, CertId* pCertId ); nn::Result AddInternalCertToCertStore( CertStoreId certStoreId, InternalCaCert internalCertName, CertId* pCertId ); nn::Result RemoveCertFromCertStore( CertStoreId certStoreId, CertId certId ); nn::Result CreateCrlStore( CrlStoreId* pCrlId ); nn::Result DestroyCrlStore( CrlStoreId crlId ); nn::Result AddCrlToCrlStore( CrlStoreId crlStoreId, const u8 pCrlData[], size_t crlDataSize, CrlId* pCertId ); nn::Result AddInternalCrlToCrlStore( CrlStoreId crlStoreId, InternalCrl internalCrlName, CrlId* pCrlId ); nn::Result RemoveCrlFromCrlStore( CrlStoreId crlStoreId, CrlId crlId ); nn::Result CreateClientCert( const u8 pCertData[], size_t certDataSize, const u8 pPrivateKeyData[], size_t privateKeyDataSize, CertId* pCertId ); nn::Result CreateInternalClientCert( InternalClientCert internalClientName, CertId* pCertId ); nn::Result DestroyClientCert( CertId ClientCert ); nn::Result GatherRandomEntropy(); nn::Result GenerateRandomBytes( u8 pRandomBuf[], size_t randomBufSize ); nn::Result InitializeConnectionSession( ConnectionHandle handle ); nn::Result DoHandshake( ConnectionHandle handle ); nn::Result DoHandshakeWithGetServerCertInfo( ConnectionHandle handle, size_t* pServerCertSizeCourier, u32* pServerCertNumCourier ); nn::Result Read( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier ); nn::Result Peek( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier ); nn::Result Write( ConnectionHandle handle, const u8 pDataBuf[], size_t dataBufSize, size_t* pWrittenDataSizeCourier ); nn::Result SetServerCertStore( ConnectionHandle handle, CertStoreId certStoreId ); nn::Result SetClientCert( ConnectionHandle handle, CertId certId ); nn::Result SetCrlStore( ConnectionHandle handle, CrlStoreId certStoreId ); nn::Result DisableVerifyOptionForDebug( ConnectionHandle handle, u32 excludeVerifyOptions ); nn::Result GetCipherInfo( ConnectionHandle handle, char8 pVersionBuf[], size_t versionBufSize, char8 pCipherKindStrBuf[], size_t cipherKindStrBufSize, s32* pAlgBitsCourier, s32* pEffectiveBitsCourier ); nn::Result GetCertVerifyErrors( ConnectionHandle handle, u32* pCertVerifyErrorsCourier ); nn::Result Shutdown( ConnectionHandle handle ); nn::Result SetServerCertBuffer( ConnectionHandle handle, nn::Handle hCertBufSharedMemory, size_t certBufSize ); nn::Result AddEVPolicyId( ConnectionHandle handle, const char8 pPolicyId[], size_t policyIdSize ); }; } // end of namespace ssl } // end of namespace nn #endif // ifndef NN_SSL___SSL_CONNECTIONIPC_H_