Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013, Regents of the University of California |
| 4 | * Yingdi Yu |
| 5 | * |
| 6 | * BSD license, See the LICENSE file for more information |
| 7 | * |
| 8 | * Author: Yingdi Yu <yingdi@cs.ucla.edu> |
| 9 | */ |
| 10 | |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 11 | #if __clang__ |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 12 | #pragma clang diagnostic ignored "-Wtautological-compare" |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 13 | #endif |
| 14 | |
| 15 | |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 16 | #include "contact-manager.h" |
| 17 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 18 | #ifndef Q_MOC_RUN |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 19 | #include <ndn-cpp-dev/face.hpp> |
| 20 | #include <ndn-cpp-dev/security/signature-sha256-with-rsa.hpp> |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 21 | |
| 22 | #ifndef WITH_SECURITY |
| 23 | #include <ndn-cpp-dev/security/validator-null.hpp> |
| 24 | #else |
| 25 | #include <ndn-cpp-dev/security/validator-regex.hpp> |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 26 | #include <cryptopp/base64.h> |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 27 | #include <ndn-cpp-dev/security/sec-rule-relative.hpp> |
| 28 | #endif |
| 29 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 30 | #include "endorse-collection.pb.h" |
Yingdi Yu | 590fa5d | 2013-10-18 18:35:09 -0700 | [diff] [blame] | 31 | #include "logging.h" |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 32 | #endif |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 33 | |
| 34 | using namespace ndn; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 35 | using namespace std; |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 36 | |
Yingdi Yu | 590fa5d | 2013-10-18 18:35:09 -0700 | [diff] [blame] | 37 | INIT_LOGGER("ContactManager"); |
| 38 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 39 | namespace chronos{ |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 40 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 41 | ContactManager::ContactManager(shared_ptr<Face> face, |
| 42 | QObject* parent) |
| 43 | : QObject(parent) |
| 44 | , m_contactStorage(new ContactStorage()) |
| 45 | , m_dnsStorage(new DnsStorage()) |
| 46 | , m_face(face) |
| 47 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 48 | initializeSecurity(); |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | ContactManager::~ContactManager() |
Yingdi Yu | accbda9 | 2013-12-27 08:44:12 +0800 | [diff] [blame] | 52 | {} |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 53 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 54 | void |
| 55 | ContactManager::initializeSecurity() |
| 56 | { |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 57 | |
| 58 | #ifndef WITH_SECURITY |
| 59 | |
| 60 | m_keyChain = make_shared<KeyChain>(); |
| 61 | m_validator = make_shared<ValidatorNull>(); |
| 62 | |
| 63 | #else |
| 64 | |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 65 | shared_ptr<SecPolicySimple> policy = make_shared<SecPolicySimple>(); |
| 66 | m_verifier = make_shared<Verifier>(policy); |
| 67 | m_verifier->setFace(m_face); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 68 | |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 69 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^([^<DNS>]*)<DNS><ENDORSED>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 70 | "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$", |
| 71 | "==", "\\1", "\\1\\2", true)); |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 72 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^([^<DNS>]*)<DNS><PROFILE>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 73 | "^([^<KEY>]*)<KEY>(<>*)[<ksk-.*><dsk-.*>]<ID-CERT>$", |
| 74 | "==", "\\1", "\\1\\2", true)); |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 75 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^([^<PROFILE-CERT>]*)<PROFILE-CERT>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 76 | "^([^<KEY>]*)<KEY>(<>*<ksk-.*>)<ID-CERT>$", |
| 77 | "==", "\\1", "\\1\\2", true)); |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 78 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 79 | "^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>$", |
| 80 | ">", "\\1\\2", "\\1", true)); |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 81 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^([^<KEY>]*)<KEY><dsk-.*><ID-CERT>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 82 | "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$", |
| 83 | "==", "\\1", "\\1\\2", true)); |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 84 | policy->addVerificationPolicyRule(make_shared<SecRuleRelative>("^(<>*)$", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 85 | "^([^<KEY>]*)<KEY>(<>*)<ksk-.*><ID-CERT>$", |
| 86 | ">", "\\1", "\\1\\2", true)); |
Yingdi Yu | 8fb16a4 | 2013-11-10 18:35:09 -0800 | [diff] [blame] | 87 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 88 | |
Yingdi Yu | 6df6125 | 2014-01-21 11:05:11 -0800 | [diff] [blame] | 89 | policy->addSigningPolicyRule(make_shared<SecRuleRelative>("^([^<DNS>]*)<DNS><PROFILE>", |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 90 | "^([^<KEY>]*)<KEY>(<>*)<><ID-CERT>", |
| 91 | "==", "\\1", "\\1\\2", true)); |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 92 | |
Yingdi Yu | 8fb16a4 | 2013-11-10 18:35:09 -0800 | [diff] [blame] | 93 | |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 94 | const string TrustAnchor("BIICqgOyEIWlKzDI2xX2hdq5Azheu9IVyewcV4uM7ylfh67Y8MIxF3tDCTx5JgEn\ |
| 95 | HYMuCaYQm6XuaXTlVfDdWff/K7Xebq8IgGxjNBeU9eMf7Gy9iIMrRAOdBG0dBHmo\ |
| 96 | 67biGs8F+P1oh1FwKu/FN1AE9vh8HSOJ94PWmjO+6PvITFIXuI3QbcCz8rhvbsfb\ |
| 97 | 5X/DmfbJ8n8c4X3nVxrBm6fd4z8kOFOvvhgJImvqsow69Uy+38m8gJrmrcWMoPBJ\ |
| 98 | WsNLcEriZCt/Dlg7EqqVrIn6ukylKCvVrxA9vm/cEB74J/N+T0JyMRDnTLm17gpq\ |
| 99 | Gd75rhj+bLmpOMOBT7Nb27wUKq8gcXzeAADy+p1uZG4A+p1LRVkA+vVrc2stMTM4\ |
| 100 | MzMyNTcyMAD6vUlELUNFUlQA+q39PgurHgAAAaID4gKF5vjua9EIr3/Fn8k1AdSc\ |
| 101 | nEryjVDW3ikvYoSwjK7egTkAArq1BSc+C6sdAAHiAery+p1uZG4A+p1LRVkA+vVr\ |
| 102 | c2stMTM4MzMyNTcyMAD6vUlELUNFUlQAAAAAAAGaFr0wggFjMCIYDzIwMTMxMTAx\ |
| 103 | MTcxMTIyWhgPMjAxNDExMDExNzExMjJaMBkwFwYDVQQpExBORE4gVGVzdGJlZCBS\ |
| 104 | b290MIIBIDANBgkqhkiG9w0BAQEFAAOCAQ0AMIIBCAKCAQEA06x+elwzWCHa4I3b\ |
| 105 | yrYCMAIVxQpRVLuOXp0h+BS+5GNgMVPi7+40o4zSJG+kiU8CIH1mtj8RQAzBX9hF\ |
| 106 | I5VAyOC8nS8D8YOfBwt2yRDZPgt1E5PpyYUBiDYuq/zmJDL8xjxAlxrMzVOqD/uj\ |
| 107 | /vkkcBM/T1t9Q6p1CpRyq+GMRbV4EAHvH7MFb6bDrH9t8DHEg7NPUCaSQBrd7PvL\ |
| 108 | 72P+QdiNH9zs/EiVzAkeMG4iniSXLuYM3z0gMqqcyUUUr6r1F9IBmDO+Kp97nZh8\ |
| 109 | VCL+cnIEwyzAFAupQH5GoXUWGiee8oKWwH2vGHX7u6sWZsCp15NMSG3OC4jUIZOE\ |
| 110 | iVUF1QIBEQAA"); |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 111 | |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 112 | string decoded; |
| 113 | CryptoPP::StringSource ss(reinterpret_cast<const unsigned char *>(TrustAnchor.c_str()), |
| 114 | TrustAnchor.size(), |
| 115 | true, |
| 116 | new CryptoPP::Base64Decoder(new CryptoPP::StringSink(decoded))); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 117 | Data data; |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 118 | data.wireDecode(Block(reinterpret_cast<const uint8_t*>(decoded.c_str()), decoded.size())); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 119 | shared_ptr<IdentityCertificate> anchor = make_shared<IdentityCertificate>(data); |
Yingdi Yu | 7630f64 | 2014-01-16 19:13:03 -0800 | [diff] [blame] | 120 | policy->addTrustAnchor(anchor); |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 121 | #endif |
Yingdi Yu | 0b82a4e | 2013-10-18 11:29:25 -0700 | [diff] [blame] | 122 | } |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 123 | |
| 124 | |
| 125 | void |
| 126 | ContactManager::fetchSelfEndorseCertificate(const ndn::Name& identity) |
| 127 | { |
| 128 | Name interestName = identity; |
| 129 | interestName.append("DNS").append("PROFILE"); |
| 130 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 131 | Interest interest(interestName); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 132 | interest.setMustBeFresh(true); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 133 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 134 | OnDataValidated onValidated = bind(&ContactManager::onDnsSelfEndorseCertValidated, this, _1, identity); |
| 135 | OnDataValidationFailed onValidationFailed = bind(&ContactManager::onDnsSelfEndorseCertValidationFailed, this, _1, identity); |
| 136 | TimeoutNotify timeoutNotify = bind(&ContactManager::onDnsSelfEndorseCertTimeoutNotify, this, identity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 137 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 138 | sendInterest(interest, onValidated, onValidationFailed, timeoutNotify); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 142 | ContactManager::onDnsSelfEndorseCertValidated(const shared_ptr<const Data>& data, |
| 143 | const Name& identity) |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 144 | { |
| 145 | try{ |
| 146 | Data plainData; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 147 | plainData.wireDecode(data->getContent().blockFromValue()); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 148 | EndorseCertificate selfEndorseCertificate(plainData); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 149 | if(Validator::verifySignature(plainData, plainData.getSignature(), selfEndorseCertificate.getPublicKeyInfo())) |
| 150 | emit contactFetched(selfEndorseCertificate); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 151 | else |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 152 | emit contactFetchFailed(identity); |
| 153 | }catch(...){ |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 154 | emit contactFetchFailed (identity); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 159 | ContactManager::fetchCollectEndorse(const Name& identity) |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 160 | { |
| 161 | Name interestName = identity; |
| 162 | interestName.append("DNS").append("ENDORSED"); |
| 163 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 164 | Interest interest(interestName); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 165 | interest.setInterestLifetime(1000); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 166 | interest.setMustBeFresh(true); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 167 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 168 | OnDataValidated onValidated = bind(&ContactManager::onDnsCollectEndorseValidated, this, _1, identity); |
| 169 | OnDataValidationFailed onValidationFailed = bind(&ContactManager::onDnsCollectEndorseValidationFailed, this, _1, identity); |
| 170 | TimeoutNotify timeoutNotify = bind(&ContactManager::onDnsCollectEndorseTimeoutNotify, this, identity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 171 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 172 | sendInterest(interest, onValidated, onValidationFailed, timeoutNotify); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 176 | ContactManager::fetchKey(const Name& certName) |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 177 | { |
| 178 | Name interestName = certName; |
| 179 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 180 | Interest interest(interestName); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 181 | interest.setInterestLifetime(1000); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 182 | interest.setMustBeFresh(true); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 183 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 184 | OnDataValidated onValidated = bind(&ContactManager::onKeyValidated, this, _1, certName); |
| 185 | OnDataValidationFailed onValidationFailed = bind(&ContactManager::onKeyValidationFailed, this, _1, certName); |
| 186 | TimeoutNotify timeoutNotify = bind(&ContactManager::onKeyTimeoutNotify, this, certName); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 187 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 188 | sendInterest(interest, onValidated, onValidationFailed, timeoutNotify); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 189 | } |
| 190 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 191 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 192 | ContactManager::onKeyValidated(const shared_ptr<const Data>& data, const Name& identity) |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 193 | { |
| 194 | IdentityCertificate identityCertificate(*data); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 195 | Profile profile(identityCertificate); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 196 | |
| 197 | try{ |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 198 | EndorseCertificate endorseCertificate(identityCertificate, profile); |
| 199 | m_keyChain->sign(endorseCertificate); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 200 | emit contactKeyFetched (endorseCertificate); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 201 | }catch(...){ |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 202 | return; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | void |
Yingdi Yu | accbda9 | 2013-12-27 08:44:12 +0800 | [diff] [blame] | 207 | ContactManager::fetchIdCertificate(const Name& certName) |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 208 | { |
| 209 | Name interestName = certName; |
| 210 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 211 | Interest interest(interestName); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 212 | interest.setInterestLifetime(1000); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 213 | interest.setMustBeFresh(true); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 214 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 215 | OnDataValidated onValidated = bind(&ContactManager::onIdCertValidated, this, _1, certName); |
| 216 | OnDataValidationFailed onValidationFailed = bind(&ContactManager::onIdCertValidationFailed, this, _1, certName); |
| 217 | TimeoutNotify timeoutNotify = bind(&ContactManager::onIdCertTimeoutNotify, this, certName); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 218 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 219 | sendInterest(interest, onValidated, onValidationFailed, timeoutNotify); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 220 | } |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 221 | |
| 222 | void |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 223 | ContactManager::updateProfileData(const Name& identity) |
| 224 | { |
| 225 | // Get current profile; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 226 | shared_ptr<Profile> newProfile = m_contactStorage->getSelfProfile(identity); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 227 | if(!static_cast<bool>(newProfile)) |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 228 | return; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 229 | |
| 230 | shared_ptr<EndorseCertificate> newEndorseCertificate = getSignedSelfEndorseCertificate(identity, *newProfile); |
| 231 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 232 | if(!static_cast<bool>(newEndorseCertificate)) |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 233 | return; |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 234 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 235 | m_contactStorage->addSelfEndorseCertificate(*newEndorseCertificate, identity); |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 236 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 237 | publishSelfEndorseCertificateInDNS(*newEndorseCertificate); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 238 | } |
| 239 | |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 240 | void |
| 241 | ContactManager::updateEndorseCertificate(const ndn::Name& identity, const ndn::Name& signerIdentity) |
| 242 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 243 | shared_ptr<EndorseCertificate> newEndorseCertificate = generateEndorseCertificate(identity, signerIdentity); |
| 244 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 245 | if(!static_cast<bool>(newEndorseCertificate)) |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 246 | return; |
| 247 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 248 | m_contactStorage->addEndorseCertificate(*newEndorseCertificate, identity); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 249 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 250 | publishEndorseCertificateInDNS(*newEndorseCertificate, signerIdentity); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 251 | } |
| 252 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 253 | shared_ptr<EndorseCertificate> |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 254 | ContactManager::generateEndorseCertificate(const Name& identity, const Name& signerIdentity) |
| 255 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 256 | shared_ptr<ContactItem> contact = getContact(identity); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 257 | if(!static_cast<bool>(contact)) |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame] | 258 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 259 | |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 260 | Name signerKeyName = m_keyChain->getDefaultKeyNameForIdentity(signerIdentity); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 261 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 262 | vector<string> endorseList; |
| 263 | m_contactStorage->getEndorseList(identity, endorseList); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 264 | |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 265 | try{ |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 266 | shared_ptr<EndorseCertificate> cert = make_shared<EndorseCertificate>(contact->getSelfEndorseCertificate(), signerKeyName, endorseList); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 267 | m_keyChain->signByIdentity(*cert, signerIdentity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 268 | return cert; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 269 | }catch(...){ |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame] | 270 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 271 | } |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 272 | } |
| 273 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 274 | shared_ptr<EndorseCertificate> |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 275 | ContactManager::getSignedSelfEndorseCertificate(const Name& identity, |
| 276 | const Profile& profile) |
| 277 | { |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 278 | Name certificateName = m_keyChain->getDefaultCertificateNameForIdentity(identity); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 279 | if(0 == certificateName.size()) |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame] | 280 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 281 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 282 | Name signingKeyName = IdentityCertificate::certificateNameToPublicKeyName(certificateName); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 283 | shared_ptr<IdentityCertificate> kskCert; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 284 | |
| 285 | if(signingKeyName.get(-1).toEscapedString().substr(0,4) == "dsk-") |
Yingdi Yu | ed8cfc4 | 2013-11-01 17:37:51 -0700 | [diff] [blame] | 286 | { |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 287 | shared_ptr<IdentityCertificate> signingCert = m_keyChain->getCertificate(certificateName); |
| 288 | if(!static_cast<bool>(signingCert)) |
| 289 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 290 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 291 | try{ |
| 292 | SignatureSha256WithRsa dskCertSig(signingCert->getSignature()); |
| 293 | Name keyName = IdentityCertificate::certificateNameToPublicKeyName(dskCertSig.getKeyLocator().getName()); |
| 294 | Name kskCertName = m_keyChain->getDefaultCertificateNameForKey(keyName); |
| 295 | kskCert = m_keyChain->getCertificate(kskCertName); |
| 296 | }catch(...){ |
| 297 | return shared_ptr<EndorseCertificate>(); |
| 298 | } |
| 299 | } |
Yingdi Yu | ed8cfc4 | 2013-11-01 17:37:51 -0700 | [diff] [blame] | 300 | else |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 301 | kskCert = m_keyChain->getCertificate(certificateName); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 302 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 303 | if(!static_cast<bool>(kskCert)) |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame] | 304 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | 6a5b9f6 | 2013-11-06 23:00:21 -0800 | [diff] [blame] | 305 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 306 | vector<string> endorseList; |
| 307 | Profile::const_iterator it = profile.begin(); |
| 308 | for(; it != profile.end(); it++) |
| 309 | endorseList.push_back(it->first); |
| 310 | |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 311 | try{ |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 312 | shared_ptr<EndorseCertificate> selfEndorseCertificate = make_shared<EndorseCertificate>(*kskCert, profile, endorseList); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 313 | m_keyChain->sign(*selfEndorseCertificate, kskCert->getName()); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 314 | return selfEndorseCertificate; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 315 | }catch(...){ |
Yingdi Yu | eaa84e2 | 2014-01-16 10:30:26 -0800 | [diff] [blame] | 316 | return shared_ptr<EndorseCertificate>(); |
Yingdi Yu | b35b865 | 2013-11-07 11:32:40 -0800 | [diff] [blame] | 317 | } |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 318 | } |
| 319 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 320 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 321 | ContactManager::publishSelfEndorseCertificateInDNS(const EndorseCertificate& selfEndorseCertificate) |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 322 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 323 | Data data; |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 324 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 325 | Name identity = selfEndorseCertificate.getPublicKeyName().getPrefix(-1); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 326 | |
| 327 | Name dnsName = identity; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 328 | dnsName.append("DNS").append("PROFILE").appendVersion(); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 329 | data.setName(dnsName); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 330 | data.setContent(selfEndorseCertificate.wireEncode()); |
| 331 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 332 | m_keyChain->signByIdentity(data, identity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 333 | m_dnsStorage->updateDnsSelfProfileData(data, identity); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 334 | m_face->put(data); |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 335 | } |
| 336 | |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 337 | void |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 338 | ContactManager::publishEndorseCertificateInDNS(const EndorseCertificate& endorseCertificate, const Name& signerIdentity) |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 339 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 340 | Data data; |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 341 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 342 | Name endorsee = endorseCertificate.getPublicKeyName().getPrefix(-1); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 343 | |
| 344 | Name dnsName = signerIdentity; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 345 | dnsName.append("DNS").append(endorsee.wireEncode()).append("ENDORSEE").appendVersion(); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 346 | data.setName(dnsName); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 347 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 348 | data.setContent(endorseCertificate.wireEncode()); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 349 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 350 | m_keyChain->signByIdentity(data, signerIdentity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 351 | m_dnsStorage->updateDnsEndorseOthers(data, signerIdentity, endorsee); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 352 | m_face->put(data); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 353 | } |
| 354 | |
| 355 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 356 | ContactManager::publishCollectEndorsedDataInDNS(const Name& identity) |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 357 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 358 | Data data; |
| 359 | |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 360 | Name dnsName = identity; |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 361 | dnsName.append("DNS").append("ENDORSED").appendVersion(); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 362 | data.setName(dnsName); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 363 | |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 364 | vector<Buffer> collectEndorseList; |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 365 | m_contactStorage->getCollectEndorseList(identity, collectEndorseList); |
| 366 | |
| 367 | Chronos::EndorseCollection endorseCollection; |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 368 | |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 369 | vector<Buffer>::const_iterator it = collectEndorseList.begin(); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 370 | for(; it != collectEndorseList.end(); it++) |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 371 | { |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 372 | string entryStr(reinterpret_cast<const char*>(it->buf()), it->size()); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 373 | endorseCollection.add_endorsement()->set_blob(entryStr); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 374 | } |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 375 | |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 376 | string encoded; |
| 377 | endorseCollection.SerializeToString(&encoded); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 378 | |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 379 | data.setContent(reinterpret_cast<const uint8_t*>(encoded.c_str()), encoded.size()); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 380 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 381 | m_keyChain->signByIdentity(data, identity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 382 | m_dnsStorage->updateDnsOthersEndorse(data, identity); |
Yingdi Yu | c9ffa9f | 2014-01-13 11:19:47 -0800 | [diff] [blame] | 383 | m_face->put(data); |
Yingdi Yu | 8dacdf2 | 2013-11-05 23:06:43 -0800 | [diff] [blame] | 384 | } |
| 385 | |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 386 | void |
| 387 | ContactManager::addContact(const IdentityCertificate& identityCertificate, const Profile& profile) |
| 388 | { |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 389 | try{ |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 390 | EndorseCertificate endorseCertificate(identityCertificate, profile); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 391 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 392 | m_keyChain->signByIdentity(endorseCertificate, m_defaultIdentity); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 393 | |
| 394 | ContactItem contactItem(endorseCertificate); |
| 395 | |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 396 | m_contactStorage->addContact(contactItem); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 397 | |
Yingdi Yu | 6ea54e4 | 2013-11-12 17:50:21 -0800 | [diff] [blame] | 398 | emit contactAdded(contactItem.getNameSpace()); |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 399 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 400 | }catch(std::runtime_error& e){ |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 401 | emit warning(e.what()); |
| 402 | _LOG_ERROR("Exception: " << e.what()); |
| 403 | return; |
| 404 | } |
| 405 | } |
| 406 | |
Yingdi Yu | 6ea54e4 | 2013-11-12 17:50:21 -0800 | [diff] [blame] | 407 | void |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 408 | ContactManager::removeContact(const Name& contactNameSpace) |
Yingdi Yu | 6ea54e4 | 2013-11-12 17:50:21 -0800 | [diff] [blame] | 409 | { |
Yingdi Yu | 6420611 | 2013-12-24 11:16:32 +0800 | [diff] [blame] | 410 | shared_ptr<ContactItem> contact = getContact(contactNameSpace); |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 411 | if(!static_cast<bool>(contact)) |
Yingdi Yu | 6ea54e4 | 2013-11-12 17:50:21 -0800 | [diff] [blame] | 412 | return; |
| 413 | m_contactStorage->removeContact(contactNameSpace); |
| 414 | emit contactRemoved(contact->getPublicKeyName()); |
| 415 | } |
Yingdi Yu | 908f841 | 2013-11-09 00:03:26 -0800 | [diff] [blame] | 416 | |
Yingdi Yu | a1a688f | 2014-02-06 18:09:22 -0800 | [diff] [blame^] | 417 | }//chronos |
| 418 | |
Yingdi Yu | aa8d769 | 2013-10-18 17:05:02 -0700 | [diff] [blame] | 419 | |
| 420 | #if WAF |
| 421 | #include "contact-manager.moc" |
| 422 | #include "contact-manager.cpp.moc" |
| 423 | #endif |