~ubuntu-branches/ubuntu/trusty/kopete/trusty

« back to all changes in this revision

Viewing changes to protocols/jabber/libiris/src/xmpp/xmpp-core/simplesasl.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2013-11-23 17:46:40 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20131123174640-gz1zjv1xqh81bi2h
Tags: 4:4.11.80-0ubuntu1
* New upstream beta release
* Bump build dependency to libotr5-dev
* Update symbols
* Update install files
* Drop new_linphone.diff, not required anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
                        capable = true;
134
134
                allow_plain = flags & QCA::SASL::AllowPlain;
135
135
        }
136
 
        
 
136
 
137
137
        virtual void setup(const QString& _service, const QString& _host, const QCA::SASLContext::HostPort*, const QCA::SASLContext::HostPort*, const QString&, int) {
138
138
                service = _service;
139
139
                host = _host;
140
140
        }
141
 
        
 
141
 
142
142
        virtual void startClient(const QStringList &mechlist, bool allowClientSendFirst) {
143
143
                Q_UNUSED(allowClientSendFirst);
144
144
 
152
152
                                mechanism_ = "DIGEST-MD5";
153
153
                                break;
154
154
                        }
155
 
                        if (mech == "PLAIN" && allow_plain) 
 
155
                        if (mech == "PLAIN" && allow_plain)
156
156
                                mechanism_ = "PLAIN";
157
157
                }
158
158
 
161
161
                        authCondition_ = QCA::SASL::NoMechanism;
162
162
                        if (!capable)
163
163
                                qWarning("simplesasl.cpp: Not enough capabilities");
164
 
                        if (mechanism_.isEmpty()) 
 
164
                        if (mechanism_.isEmpty())
165
165
                                qWarning("simplesasl.cpp: No mechanism available");
166
166
                        QMetaObject::invokeMethod(this, "resultsReady", Qt::QueuedConnection);
167
167
                        return;
180
180
 
181
181
        virtual void tryAgain() {
182
182
                // All exits of the method must emit the ready signal
183
 
                // so all exits go through a goto ready; 
 
183
                // so all exits go through a goto ready;
184
184
                if(step == 0) {
185
185
                        out_mech = mechanism_;
186
 
                        
187
 
                        // PLAIN 
 
186
 
 
187
                        // PLAIN
188
188
                        if (out_mech == "PLAIN" or out_mech == "SCRAM-SHA-1") {
189
189
                                // First, check if we have everything
190
190
                                if(need.user || need.pass) {
258
258
                                        result_ = Error;
259
259
                                        goto ready;
260
260
                                }
261
 
                                
 
261
 
262
262
                                // see if some params are needed
263
263
                                if(!have.user)
264
264
                                        need.user = true;
336
336
        virtual QStringList mechlist() const {
337
337
                return QStringList();
338
338
        }
339
 
        
 
339
 
340
340
        virtual QString mech() const {
341
341
                return out_mech;
342
342
        }
343
 
        
 
343
 
344
344
        virtual bool haveClientInit() const {
345
345
                return out_mech == "PLAIN";
346
346
        }
347
 
        
 
347
 
348
348
        virtual QByteArray stepData() const {
349
349
                return out_buf;
350
350
        }
351
 
        
 
351
 
352
352
        virtual QByteArray to_net() {
353
353
                return result_to_net_;
354
354
        }
355
 
        
 
355
 
356
356
        virtual int encoded() const {
357
357
                return encoded_;
358
358
        }
359
 
        
 
359
 
360
360
        virtual QByteArray to_app() {
361
361
                return result_to_app_;
362
362
        }
372
372
        virtual QCA::SASL::Params clientParams() const {
373
373
                return QCA::SASL::Params(need.user, need.authzid, need.pass, need.realm);
374
374
        }
375
 
        
 
375
 
376
376
        virtual void setClientParams(const QString *_user, const QString *_authzid, const QCA::SecureArray *_pass, const QString *_realm) {
377
377
                if(_user) {
378
378
                        user = *_user;
415
415
                // TODO: Copy all the members
416
416
                return s;
417
417
        }
418
 
        
 
418
 
419
419
        virtual void startServer(const QString &, bool) {
420
420
                result_ =  QCA::SASLContext::Error;
421
421
                QMetaObject::invokeMethod(this, "resultsReady", Qt::QueuedConnection);