1 /*---------------------------------------------------------------------------* 2 Project: Horizon 3 File: ssl_ConnectionIpc.h 4 5 Copyright (C)2009 Nintendo Co., Ltd. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain 8 proprietary information of Nintendo of America Inc. and/or Nintendo 9 Company Ltd., and are protected by Federal copyright law. They may 10 not be disclosed to third parties or copied or duplicated in any form, 11 in whole or in part, without the prior written consent of Nintendo. 12 13 $Rev: 28664 $ 14 *---------------------------------------------------------------------------*/ 15 16 // 17 // Do not edit this file. 18 // This file is automatically generated. 19 // 20 21 #ifndef NN_SSL___SSL_CONNECTIONIPC_H_ 22 #define NN_SSL___SSL_CONNECTIONIPC_H_ 23 24 #include <nn/Handle.h> 25 #include <nn/Result.h> 26 #include <nn/types.h> 27 #include <nn/ssl/ssl_Types.h> 28 #include <nn/ssl/ssl_Const.h> 29 #include <nn/ssl/ssl_Result.h> 30 31 32 33 namespace nn { 34 namespace ssl { 35 36 class ConnectionIpc 37 { 38 public: 39 enum Tag 40 { 41 TAG_IPC_ERROR, 42 TAG_INITIALIZE_GENERAL_SESSION = 0x0001, 43 TAG_NEW_CLIENT = 0x0002, 44 TAG_CREATE_CERT_STORE = 0x0003, 45 TAG_DESTROY_CERT_STORE = 0x0004, 46 TAG_ADD_CERT_TO_CERT_STORE = 0x0005, 47 TAG_ADD_INTERNAL_CERT_TO_CERT_STORE = 0x0006, 48 TAG_REMOVE_CERT_FROM_CERT_STORE = 0x0007, 49 TAG_CREATE_CRL_STORE = 0x0008, 50 TAG_DESTROY_CRL_STORE = 0x0009, 51 TAG_ADD_CRL_TO_CRL_STORE = 0x000a, 52 TAG_ADD_INTERNAL_CRL_TO_CRL_STORE = 0x000b, 53 TAG_REMOVE_CRL_FROM_CRL_STORE = 0x000c, 54 TAG_CREATE_CLIENT_CERT = 0x000d, 55 TAG_CREATE_INTERNAL_CLIENT_CERT = 0x000e, 56 TAG_DESTROY_CLIENT_CERT = 0x000f, 57 TAG_GATHER_RANDOM_ENTROPY = 0x0010, 58 TAG_GENERATE_RANDOM_BYTES = 0x0011, 59 TAG_INITIALIZE_CONNECTION_SESSION = 0x0012, 60 TAG_DO_HANDSHAKE = 0x0013, 61 TAG_DO_HANDSHAKE_WITH_GET_SERVER_CERT_INFO = 0x0014, 62 TAG_READ = 0x0015, 63 TAG_PEEK = 0x0016, 64 TAG_WRITE = 0x0017, 65 TAG_SET_SERVER_CERT_STORE = 0x0018, 66 TAG_SET_CLIENT_CERT = 0x0019, 67 TAG_SET_CRL_STORE = 0x001a, 68 TAG_DISABLE_VERIFY_OPTION_FOR_DEBUG = 0x001b, 69 TAG_GET_CIPHER_INFO = 0x001c, 70 TAG_GET_CERT_VERIFY_ERRORS = 0x001d, 71 TAG_SHUTDOWN = 0x001e, 72 TAG_SET_SERVER_CERT_BUFFER = 0x001f, 73 TAG_ADD_EV_POLICY_ID = 0x0020, 74 TAG_IPC_END 75 }; 76 77 private: 78 Handle m_Session; 79 80 public: ConnectionIpc(Handle session)81 ConnectionIpc(Handle session) : m_Session(session) {} 82 83 public: 84 nn::Result InitializeGeneralSession(); 85 nn::Result NewClient( s32 socket, u32 verifyOpt, const char8 pServerPath[], size_t serverPathSize, ConnectionHandle* handleCourier ); 86 nn::Result CreateCertStore( CertStoreId* pCertId ); 87 nn::Result DestroyCertStore( CertStoreId certId ); 88 nn::Result AddCertToCertStore( CertStoreId certStoreId, const u8 pCertData[], size_t certDataSize, CertId* pCertId ); 89 nn::Result AddInternalCertToCertStore( CertStoreId certStoreId, InternalCaCert internalCertName, CertId* pCertId ); 90 nn::Result RemoveCertFromCertStore( CertStoreId certStoreId, CertId certId ); 91 nn::Result CreateCrlStore( CrlStoreId* pCrlId ); 92 nn::Result DestroyCrlStore( CrlStoreId crlId ); 93 nn::Result AddCrlToCrlStore( CrlStoreId crlStoreId, const u8 pCrlData[], size_t crlDataSize, CrlId* pCertId ); 94 nn::Result AddInternalCrlToCrlStore( CrlStoreId crlStoreId, InternalCrl internalCrlName, CrlId* pCrlId ); 95 nn::Result RemoveCrlFromCrlStore( CrlStoreId crlStoreId, CrlId crlId ); 96 nn::Result CreateClientCert( const u8 pCertData[], size_t certDataSize, const u8 pPrivateKeyData[], size_t privateKeyDataSize, CertId* pCertId ); 97 nn::Result CreateInternalClientCert( InternalClientCert internalClientName, CertId* pCertId ); 98 nn::Result DestroyClientCert( CertId ClientCert ); 99 nn::Result GatherRandomEntropy(); 100 nn::Result GenerateRandomBytes( u8 pRandomBuf[], size_t randomBufSize ); 101 nn::Result InitializeConnectionSession( ConnectionHandle handle ); 102 nn::Result DoHandshake( ConnectionHandle handle ); 103 nn::Result DoHandshakeWithGetServerCertInfo( ConnectionHandle handle, size_t* pServerCertSizeCourier, u32* pServerCertNumCourier ); 104 nn::Result Read( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier ); 105 nn::Result Peek( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier ); 106 nn::Result Write( ConnectionHandle handle, const u8 pDataBuf[], size_t dataBufSize, size_t* pWrittenDataSizeCourier ); 107 nn::Result SetServerCertStore( ConnectionHandle handle, CertStoreId certStoreId ); 108 nn::Result SetClientCert( ConnectionHandle handle, CertId certId ); 109 nn::Result SetCrlStore( ConnectionHandle handle, CrlStoreId certStoreId ); 110 nn::Result DisableVerifyOptionForDebug( ConnectionHandle handle, u32 excludeVerifyOptions ); 111 nn::Result GetCipherInfo( ConnectionHandle handle, char8 pVersionBuf[], size_t versionBufSize, char8 pCipherKindStrBuf[], size_t cipherKindStrBufSize, s32* pAlgBitsCourier, s32* pEffectiveBitsCourier ); 112 nn::Result GetCertVerifyErrors( ConnectionHandle handle, u32* pCertVerifyErrorsCourier ); 113 nn::Result Shutdown( ConnectionHandle handle ); 114 nn::Result SetServerCertBuffer( ConnectionHandle handle, nn::Handle hCertBufSharedMemory, size_t certBufSize ); 115 nn::Result AddEVPolicyId( ConnectionHandle handle, const char8 pPolicyId[], size_t policyIdSize ); 116 }; 117 118 } // end of namespace ssl 119 } // end of namespace nn 120 121 122 123 #endif // ifndef NN_SSL___SSL_CONNECTIONIPC_H_ 124