OLD | NEW |
(Empty) | |
| 1 // Copyright 2004 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "third_party/libjingle_xmpp/xmllite/xmlelement.h" |
| 6 #include "third_party/libjingle_xmpp/xmpp/constants.h" |
| 7 #include "third_party/libjingle_xmpp/xmpp/saslmechanism.h" |
| 8 #include "webrtc/base/base64.h" |
| 9 |
| 10 using rtc::Base64; |
| 11 |
| 12 namespace buzz { |
| 13 |
| 14 XmlElement * |
| 15 SaslMechanism::StartSaslAuth() { |
| 16 return new XmlElement(QN_SASL_AUTH, true); |
| 17 } |
| 18 |
| 19 XmlElement * |
| 20 SaslMechanism::HandleSaslChallenge(const XmlElement * challenge) { |
| 21 return new XmlElement(QN_SASL_ABORT, true); |
| 22 } |
| 23 |
| 24 void |
| 25 SaslMechanism::HandleSaslSuccess(const XmlElement * success) { |
| 26 } |
| 27 |
| 28 void |
| 29 SaslMechanism::HandleSaslFailure(const XmlElement * failure) { |
| 30 } |
| 31 |
| 32 std::string |
| 33 SaslMechanism::Base64Encode(const std::string & plain) { |
| 34 return Base64::Encode(plain); |
| 35 } |
| 36 |
| 37 std::string |
| 38 SaslMechanism::Base64Decode(const std::string & encoded) { |
| 39 return Base64::Decode(encoded, Base64::DO_LAX); |
| 40 } |
| 41 |
| 42 std::string |
| 43 SaslMechanism::Base64EncodeFromArray(const char * plain, size_t length) { |
| 44 std::string result; |
| 45 Base64::EncodeFromArray(plain, length, &result); |
| 46 return result; |
| 47 } |
| 48 |
| 49 } |
OLD | NEW |