00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./kssld.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KSSLD_fhash = 29;
00016 static const char* const KSSLD_ftable[28][3] = {
00017 { "void", "cacheAddCertificate(KSSLCertificate,KSSLCertificateCache::KSSLCertificatePolicy,bool)", "cacheAddCertificate(KSSLCertificate cert,KSSLCertificateCache::KSSLCertificatePolicy policy,bool permanent)" },
00018 { "KSSLCertificateCache::KSSLCertificatePolicy", "cacheGetPolicyByCN(QString)", "cacheGetPolicyByCN(QString cn)" },
00019 { "KSSLCertificateCache::KSSLCertificatePolicy", "cacheGetPolicyByCertificate(KSSLCertificate)", "cacheGetPolicyByCertificate(KSSLCertificate cert)" },
00020 { "bool", "cacheSeenCN(QString)", "cacheSeenCN(QString cn)" },
00021 { "bool", "cacheSeenCertificate(KSSLCertificate)", "cacheSeenCertificate(KSSLCertificate cert)" },
00022 { "bool", "cacheRemoveByCN(QString)", "cacheRemoveByCN(QString cn)" },
00023 { "bool", "cacheRemoveBySubject(QString)", "cacheRemoveBySubject(QString subject)" },
00024 { "bool", "cacheRemoveByCertificate(KSSLCertificate)", "cacheRemoveByCertificate(KSSLCertificate cert)" },
00025 { "bool", "cacheIsPermanent(KSSLCertificate)", "cacheIsPermanent(KSSLCertificate cert)" },
00026 { "void", "cacheReload()", "cacheReload()" },
00027 { "bool", "cacheModifyByCN(QString,KSSLCertificateCache::KSSLCertificatePolicy,bool,QDateTime)", "cacheModifyByCN(QString cn,KSSLCertificateCache::KSSLCertificatePolicy policy,bool permanent,QDateTime expires)" },
00028 { "bool", "cacheModifyByCertificate(KSSLCertificate,KSSLCertificateCache::KSSLCertificatePolicy,bool,QDateTime)", "cacheModifyByCertificate(KSSLCertificate cert,KSSLCertificateCache::KSSLCertificatePolicy policy,bool permanent,QDateTime expires)" },
00029 { "QStringList", "cacheGetHostList(KSSLCertificate)", "cacheGetHostList(KSSLCertificate cert)" },
00030 { "bool", "cacheAddHost(KSSLCertificate,QString)", "cacheAddHost(KSSLCertificate cert,QString host)" },
00031 { "bool", "cacheRemoveHost(KSSLCertificate,QString)", "cacheRemoveHost(KSSLCertificate cert,QString host)" },
00032 { "void", "caVerifyUpdate()", "caVerifyUpdate()" },
00033 { "bool", "caRegenerate()", "caRegenerate()" },
00034 { "QStringList", "caList()", "caList()" },
00035 { "bool", "caUseForSSL(QString)", "caUseForSSL(QString subject)" },
00036 { "bool", "caUseForEmail(QString)", "caUseForEmail(QString subject)" },
00037 { "bool", "caUseForCode(QString)", "caUseForCode(QString subject)" },
00038 { "bool", "caAdd(QString,bool,bool,bool)", "caAdd(QString certificate,bool ssl,bool email,bool code)" },
00039 { "bool", "caRemove(QString)", "caRemove(QString subject)" },
00040 { "QString", "caGetCert(QString)", "caGetCert(QString subject)" },
00041 { "bool", "caSetUse(QString,bool,bool,bool)", "caSetUse(QString subject,bool ssl,bool email,bool code)" },
00042 { "QStringList", "getKDEKeyByEmail(QString)", "getKDEKeyByEmail(QString email)" },
00043 { "KSSLCertificate", "getCertByMD5Digest(QString)", "getCertByMD5Digest(QString key)" },
00044 { 0, 0, 0 }
00045 };
00046 static const int KSSLD_ftable_hiddens[27] = {
00047 0,
00048 0,
00049 0,
00050 0,
00051 0,
00052 0,
00053 0,
00054 0,
00055 0,
00056 0,
00057 0,
00058 0,
00059 0,
00060 0,
00061 0,
00062 0,
00063 0,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 0,
00070 0,
00071 0,
00072 0,
00073 0,
00074 };
00075
00076 bool KSSLD::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00077 {
00078 static QAsciiDict<int>* fdict = 0;
00079 if ( !fdict ) {
00080 fdict = new QAsciiDict<int>( KSSLD_fhash, true, false );
00081 for ( int i = 0; KSSLD_ftable[i][1]; i++ )
00082 fdict->insert( KSSLD_ftable[i][1], new int( i ) );
00083 }
00084 int* fp = fdict->find( fun );
00085 switch ( fp?*fp:-1) {
00086 case 0: {
00087 KSSLCertificate arg0;
00088 KSSLCertificateCache::KSSLCertificatePolicy arg1;
00089 bool arg2;
00090 QDataStream arg( data, IO_ReadOnly );
00091 arg >> arg0;
00092 arg >> arg1;
00093 arg >> arg2;
00094 replyType = KSSLD_ftable[0][0];
00095 cacheAddCertificate(arg0, arg1, arg2 );
00096 } break;
00097 case 1: {
00098 QString arg0;
00099 QDataStream arg( data, IO_ReadOnly );
00100 arg >> arg0;
00101 replyType = KSSLD_ftable[1][0];
00102 QDataStream _replyStream( replyData, IO_WriteOnly );
00103 _replyStream << cacheGetPolicyByCN(arg0 );
00104 } break;
00105 case 2: {
00106 KSSLCertificate arg0;
00107 QDataStream arg( data, IO_ReadOnly );
00108 arg >> arg0;
00109 replyType = KSSLD_ftable[2][0];
00110 QDataStream _replyStream( replyData, IO_WriteOnly );
00111 _replyStream << cacheGetPolicyByCertificate(arg0 );
00112 } break;
00113 case 3: {
00114 QString arg0;
00115 QDataStream arg( data, IO_ReadOnly );
00116 arg >> arg0;
00117 replyType = KSSLD_ftable[3][0];
00118 QDataStream _replyStream( replyData, IO_WriteOnly );
00119 _replyStream << cacheSeenCN(arg0 );
00120 } break;
00121 case 4: {
00122 KSSLCertificate arg0;
00123 QDataStream arg( data, IO_ReadOnly );
00124 arg >> arg0;
00125 replyType = KSSLD_ftable[4][0];
00126 QDataStream _replyStream( replyData, IO_WriteOnly );
00127 _replyStream << cacheSeenCertificate(arg0 );
00128 } break;
00129 case 5: {
00130 QString arg0;
00131 QDataStream arg( data, IO_ReadOnly );
00132 arg >> arg0;
00133 replyType = KSSLD_ftable[5][0];
00134 QDataStream _replyStream( replyData, IO_WriteOnly );
00135 _replyStream << cacheRemoveByCN(arg0 );
00136 } break;
00137 case 6: {
00138 QString arg0;
00139 QDataStream arg( data, IO_ReadOnly );
00140 arg >> arg0;
00141 replyType = KSSLD_ftable[6][0];
00142 QDataStream _replyStream( replyData, IO_WriteOnly );
00143 _replyStream << cacheRemoveBySubject(arg0 );
00144 } break;
00145 case 7: {
00146 KSSLCertificate arg0;
00147 QDataStream arg( data, IO_ReadOnly );
00148 arg >> arg0;
00149 replyType = KSSLD_ftable[7][0];
00150 QDataStream _replyStream( replyData, IO_WriteOnly );
00151 _replyStream << cacheRemoveByCertificate(arg0 );
00152 } break;
00153 case 8: {
00154 KSSLCertificate arg0;
00155 QDataStream arg( data, IO_ReadOnly );
00156 arg >> arg0;
00157 replyType = KSSLD_ftable[8][0];
00158 QDataStream _replyStream( replyData, IO_WriteOnly );
00159 _replyStream << cacheIsPermanent(arg0 );
00160 } break;
00161 case 9: {
00162 replyType = KSSLD_ftable[9][0];
00163 cacheReload( );
00164 } break;
00165 case 10: {
00166 QString arg0;
00167 KSSLCertificateCache::KSSLCertificatePolicy arg1;
00168 bool arg2;
00169 QDateTime arg3;
00170 QDataStream arg( data, IO_ReadOnly );
00171 arg >> arg0;
00172 arg >> arg1;
00173 arg >> arg2;
00174 arg >> arg3;
00175 replyType = KSSLD_ftable[10][0];
00176 QDataStream _replyStream( replyData, IO_WriteOnly );
00177 _replyStream << cacheModifyByCN(arg0, arg1, arg2, arg3 );
00178 } break;
00179 case 11: {
00180 KSSLCertificate arg0;
00181 KSSLCertificateCache::KSSLCertificatePolicy arg1;
00182 bool arg2;
00183 QDateTime arg3;
00184 QDataStream arg( data, IO_ReadOnly );
00185 arg >> arg0;
00186 arg >> arg1;
00187 arg >> arg2;
00188 arg >> arg3;
00189 replyType = KSSLD_ftable[11][0];
00190 QDataStream _replyStream( replyData, IO_WriteOnly );
00191 _replyStream << cacheModifyByCertificate(arg0, arg1, arg2, arg3 );
00192 } break;
00193 case 12: {
00194 KSSLCertificate arg0;
00195 QDataStream arg( data, IO_ReadOnly );
00196 arg >> arg0;
00197 replyType = KSSLD_ftable[12][0];
00198 QDataStream _replyStream( replyData, IO_WriteOnly );
00199 _replyStream << cacheGetHostList(arg0 );
00200 } break;
00201 case 13: {
00202 KSSLCertificate arg0;
00203 QString arg1;
00204 QDataStream arg( data, IO_ReadOnly );
00205 arg >> arg0;
00206 arg >> arg1;
00207 replyType = KSSLD_ftable[13][0];
00208 QDataStream _replyStream( replyData, IO_WriteOnly );
00209 _replyStream << cacheAddHost(arg0, arg1 );
00210 } break;
00211 case 14: {
00212 KSSLCertificate arg0;
00213 QString arg1;
00214 QDataStream arg( data, IO_ReadOnly );
00215 arg >> arg0;
00216 arg >> arg1;
00217 replyType = KSSLD_ftable[14][0];
00218 QDataStream _replyStream( replyData, IO_WriteOnly );
00219 _replyStream << cacheRemoveHost(arg0, arg1 );
00220 } break;
00221 case 15: {
00222 replyType = KSSLD_ftable[15][0];
00223 caVerifyUpdate( );
00224 } break;
00225 case 16: {
00226 replyType = KSSLD_ftable[16][0];
00227 QDataStream _replyStream( replyData, IO_WriteOnly );
00228 _replyStream << caRegenerate( );
00229 } break;
00230 case 17: {
00231 replyType = KSSLD_ftable[17][0];
00232 QDataStream _replyStream( replyData, IO_WriteOnly );
00233 _replyStream << caList( );
00234 } break;
00235 case 18: {
00236 QString arg0;
00237 QDataStream arg( data, IO_ReadOnly );
00238 arg >> arg0;
00239 replyType = KSSLD_ftable[18][0];
00240 QDataStream _replyStream( replyData, IO_WriteOnly );
00241 _replyStream << caUseForSSL(arg0 );
00242 } break;
00243 case 19: {
00244 QString arg0;
00245 QDataStream arg( data, IO_ReadOnly );
00246 arg >> arg0;
00247 replyType = KSSLD_ftable[19][0];
00248 QDataStream _replyStream( replyData, IO_WriteOnly );
00249 _replyStream << caUseForEmail(arg0 );
00250 } break;
00251 case 20: {
00252 QString arg0;
00253 QDataStream arg( data, IO_ReadOnly );
00254 arg >> arg0;
00255 replyType = KSSLD_ftable[20][0];
00256 QDataStream _replyStream( replyData, IO_WriteOnly );
00257 _replyStream << caUseForCode(arg0 );
00258 } break;
00259 case 21: {
00260 QString arg0;
00261 bool arg1;
00262 bool arg2;
00263 bool arg3;
00264 QDataStream arg( data, IO_ReadOnly );
00265 arg >> arg0;
00266 arg >> arg1;
00267 arg >> arg2;
00268 arg >> arg3;
00269 replyType = KSSLD_ftable[21][0];
00270 QDataStream _replyStream( replyData, IO_WriteOnly );
00271 _replyStream << caAdd(arg0, arg1, arg2, arg3 );
00272 } break;
00273 case 22: {
00274 QString arg0;
00275 QDataStream arg( data, IO_ReadOnly );
00276 arg >> arg0;
00277 replyType = KSSLD_ftable[22][0];
00278 QDataStream _replyStream( replyData, IO_WriteOnly );
00279 _replyStream << caRemove(arg0 );
00280 } break;
00281 case 23: {
00282 QString arg0;
00283 QDataStream arg( data, IO_ReadOnly );
00284 arg >> arg0;
00285 replyType = KSSLD_ftable[23][0];
00286 QDataStream _replyStream( replyData, IO_WriteOnly );
00287 _replyStream << caGetCert(arg0 );
00288 } break;
00289 case 24: {
00290 QString arg0;
00291 bool arg1;
00292 bool arg2;
00293 bool arg3;
00294 QDataStream arg( data, IO_ReadOnly );
00295 arg >> arg0;
00296 arg >> arg1;
00297 arg >> arg2;
00298 arg >> arg3;
00299 replyType = KSSLD_ftable[24][0];
00300 QDataStream _replyStream( replyData, IO_WriteOnly );
00301 _replyStream << caSetUse(arg0, arg1, arg2, arg3 );
00302 } break;
00303 case 25: {
00304 QString arg0;
00305 QDataStream arg( data, IO_ReadOnly );
00306 arg >> arg0;
00307 replyType = KSSLD_ftable[25][0];
00308 QDataStream _replyStream( replyData, IO_WriteOnly );
00309 _replyStream << getKDEKeyByEmail(arg0 );
00310 } break;
00311 case 26: {
00312 QString arg0;
00313 QDataStream arg( data, IO_ReadOnly );
00314 arg >> arg0;
00315 replyType = KSSLD_ftable[26][0];
00316 QDataStream _replyStream( replyData, IO_WriteOnly );
00317 _replyStream << getCertByMD5Digest(arg0 );
00318 } break;
00319 default:
00320 return KDEDModule::process( fun, data, replyType, replyData );
00321 }
00322 return true;
00323 }
00324
00325 QCStringList KSSLD::interfaces()
00326 {
00327 QCStringList ifaces = KDEDModule::interfaces();
00328 ifaces += "KSSLD";
00329 return ifaces;
00330 }
00331
00332 QCStringList KSSLD::functions()
00333 {
00334 QCStringList funcs = KDEDModule::functions();
00335 for ( int i = 0; KSSLD_ftable[i][2]; i++ ) {
00336 if (KSSLD_ftable_hiddens[i])
00337 continue;
00338 QCString func = KSSLD_ftable[i][0];
00339 func += ' ';
00340 func += KSSLD_ftable[i][2];
00341 funcs << func;
00342 }
00343 return funcs;
00344 }
00345
00346