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: 19958 $
14  *---------------------------------------------------------------------------*/
15 
16 //
17 // このファイルを編集しないでください。
18 // このファイルは自動生成されます。
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,
43             TAG_NEW_CLIENT,
44             TAG_CREATE_CERT_STORE,
45             TAG_DESTROY_CERT_STORE,
46             TAG_ADD_CERT_TO_CERT_STORE,
47             TAG_ADD_INTERNAL_CERT_TO_CERT_STORE,
48             TAG_REMOVE_CERT_FROM_CERT_STORE,
49             TAG_CREATE_CRL_STORE,
50             TAG_DESTROY_CRL_STORE,
51             TAG_ADD_CRL_TO_CRL_STORE,
52             TAG_ADD_INTERNAL_CRL_TO_CRL_STORE,
53             TAG_REMOVE_CRL_FROM_CRL_STORE,
54             TAG_CREATE_CLIENT_CERT,
55             TAG_CREATE_INTERNAL_CLIENT_CERT,
56             TAG_DESTROY_CLIENT_CERT,
57             TAG_GATHER_RANDOM_ENTROPY,
58             TAG_GENERATE_RANDOM_BYTES,
59             TAG_INITIALIZE_CONNECTION_SESSION,
60             TAG_DO_HANDSHAKE,
61             TAG_DO_HANDSHAKE_WITH_GET_SERVER_CERT_INFO,
62             TAG_READ,
63             TAG_PEEK,
64             TAG_WRITE,
65             TAG_SET_SERVER_CERT_STORE,
66             TAG_SET_CLIENT_CERT,
67             TAG_SET_CRL_STORE,
68             TAG_DISABLE_VERIFY_OPTION_FOR_DEBUG,
69             TAG_GET_CIPHER_INFO,
70             TAG_GET_CERT_VERIFY_ERRORS,
71             TAG_SHUTDOWN,
72             TAG_SET_SERVER_CERT_BUFFER,
73             TAG_IPC_END
74         };
75 
76     private:
77         Handle m_Session;
78 
79     public:
ConnectionIpc(Handle session)80         ConnectionIpc(Handle session) : m_Session(session) {}
81 
82     public:
83         nn::Result InitializeGeneralSession();
84         nn::Result NewClient( s32 socket, u32 verifyOpt, const char8 pServerPath[], size_t serverPathSize, ConnectionHandle* handleCourier );
85         nn::Result CreateCertStore( CertStoreId* pCertId );
86         nn::Result DestroyCertStore( CertStoreId certId );
87         nn::Result AddCertToCertStore( CertStoreId certStoreId, const u8 pCertData[], size_t certDataSize, CertId* pCertId );
88         nn::Result AddInternalCertToCertStore( CertStoreId certStoreId, InternalCaCert internalCertName, CertId* pCertId );
89         nn::Result RemoveCertFromCertStore( CertStoreId certStoreId, CertId certId );
90         nn::Result CreateCrlStore( CrlStoreId* pCrlId );
91         nn::Result DestroyCrlStore( CrlStoreId crlId );
92         nn::Result AddCrlToCrlStore( CrlStoreId crlStoreId, const u8 pCrlData[], size_t crlDataSize, CrlId* pCertId );
93         nn::Result AddInternalCrlToCrlStore( CrlStoreId crlStoreId, InternalCrl internalCrlName, CrlId* pCrlId );
94         nn::Result RemoveCrlFromCrlStore( CrlStoreId crlStoreId, CrlId crlId );
95         nn::Result CreateClientCert( const u8 pCertData[], size_t certDataSize, const u8 pPrivateKeyData[], size_t privateKeyDataSize, CertId* pCertId );
96         nn::Result CreateInternalClientCert( InternalClientCert internalClientName, CertId* pCertId );
97         nn::Result DestroyClientCert( CertId ClientCert );
98         nn::Result GatherRandomEntropy();
99         nn::Result GenerateRandomBytes( u8 pRandomBuf[], size_t randomBufSize );
100         nn::Result InitializeConnectionSession( ConnectionHandle handle );
101         nn::Result DoHandshake( ConnectionHandle handle );
102         nn::Result DoHandshakeWithGetServerCertInfo( ConnectionHandle handle, size_t* pServerCertSizeCourier, u32* pServerCertNumCourier );
103         nn::Result Read( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier );
104         nn::Result Peek( ConnectionHandle handle, u8 pDataBuf[], size_t dataBufSize, size_t* pReadSizeCourier );
105         nn::Result Write( ConnectionHandle handle, const u8 pDataBuf[], size_t dataBufSize, size_t* pWrittenDataSizeCourier );
106         nn::Result SetServerCertStore( ConnectionHandle handle, CertStoreId certStoreId );
107         nn::Result SetClientCert( ConnectionHandle handle, CertId certId );
108         nn::Result SetCrlStore( ConnectionHandle handle, CrlStoreId certStoreId );
109         nn::Result DisableVerifyOptionForDebug( ConnectionHandle handle, u32 excludeVerifyOptions );
110         nn::Result GetCipherInfo( ConnectionHandle handle, char8 pVersionBuf[], size_t versionBufSize, char8 pCipherKindStrBuf[], size_t cipherKindStrBufSize, s32* pAlgBitsCourier, s32* pEffectiveBitsCourier );
111         nn::Result GetCertVerifyErrors( ConnectionHandle handle, u32* pCertVerifyErrorsCourier );
112         nn::Result Shutdown( ConnectionHandle handle );
113         nn::Result SetServerCertBuffer( ConnectionHandle handle, nn::Handle hCertBufSharedMemory, size_t certBufSize );
114     };
115 
116 } // end of namespace ssl
117 } // end of namespace nn
118 
119 
120 
121 #endif  // ifndef NN_SSL___SSL_CONNECTIONIPC_H_
122