From c1c1308ba8ad4b4668c860e99f36a35871d02eb7 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 10 Aug 2018 22:21:03 +0300 Subject: [PATCH] Update layer 85. GitOrigin-RevId: 65fb62fea07f05637b2b652f09a4a6be2de3346b --- td/generate/scheme/telegram_api.tl | 12 ++++++------ td/generate/scheme/telegram_api.tlo | Bin 164192 -> 164268 bytes td/telegram/SecureManager.cpp | 19 ++++++------------- td/telegram/SecureManager.h | 2 -- td/telegram/SecureValue.cpp | 4 ++-- 5 files changed, 14 insertions(+), 23 deletions(-) diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 4acd6be52..2459c306d 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -873,9 +873,9 @@ secureValueTypeTemporaryRegistration#ea02ec33 = SecureValueType; secureValueTypePhone#b320aadb = SecureValueType; secureValueTypeEmail#8e3ca7ee = SecureValueType; -secureValue flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translations:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue; +secureValue#187fa0ca flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?SecureFile reverse_side:flags.2?SecureFile selfie:flags.3?SecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData hash:bytes = SecureValue; -inputSecureValue#8ec23218 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translations:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue; +inputSecureValue#db21d0a7 flags:# type:SecureValueType data:flags.0?SecureData front_side:flags.1?InputSecureFile reverse_side:flags.2?InputSecureFile selfie:flags.3?InputSecureFile translation:flags.6?Vector files:flags.4?Vector plain_data:flags.5?SecurePlainData = InputSecureValue; secureValueHash#ed1ecdb0 type:SecureValueType hash:bytes = SecureValueHash; @@ -887,11 +887,11 @@ secureValueErrorFile#7a700873 type:SecureValueType file_hash:bytes text:string = secureValueErrorFiles#666220e9 type:SecureValueType file_hash:Vector text:string = SecureValueError; secureValueError#869d758f type:SecureValueType hash:bytes text:string = SecureValueError; secureValueErrorTranslation#5fbc1134 type:SecureValueType file_hash:bytes text:string = SecureValueError; -secureValueErrorTranslations type:SecureValueType file_hash:Vector text:string = SecureValueError; +secureValueErrorTranslations#781e629b type:SecureValueType file_hash:Vector text:string = SecureValueError; secureCredentialsEncrypted#33f0ea47 data:bytes hash:bytes secret:bytes = SecureCredentialsEncrypted; -account.authorizationForm#ad2e1cd8 flags:# selfie_required:flags.1?true translation_required:flags.2?true required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm; +account.authorizationForm#ad2e1cd8 flags:# required_types:Vector values:Vector errors:Vector users:Vector privacy_policy_url:flags.0?string = account.AuthorizationForm; account.sentEmailCode#811f854f email_pattern:string length:int = account.SentEmailCode; @@ -914,8 +914,8 @@ secureSecretSettings#1527bcac secure_algo:SecurePasswordKdfAlgo secure_secret:by inputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP; inputCheckPasswordSRP#d27ff082 srp_id:long A:bytes M1:bytes = InputCheckPasswordSRP; -secureRequiredType#c84462de type:SecureValueType = SecureRequiredType; -secureRequiredTypeOneOf#193c4874 types:Vector = SecureRequiredType; +secureRequiredType#829d99da flags:# native_names:flags.0?true selfie_required:flags.1?true translation_required:flags.2?true type:SecureValueType = SecureRequiredType; +secureRequiredTypeOneOf#27477b4 types:Vector = SecureRequiredType; ---functions--- diff --git a/td/generate/scheme/telegram_api.tlo b/td/generate/scheme/telegram_api.tlo index 859a016be3326319f770253c8c565c3cb7709425..ba76627ed085113a63b72eb9bed8aa7dcc6b54db 100644 GIT binary patch delta 402 zcmaFR#I>fGYr_v-mgN@|Z*Ts?dxw)H@7>FW$#=vPSWYddmsso|u}B6aCy<#}P+Ah4 znp|3x8kU$-n##by01}@ZFv(zY&#p5(+$BYcdBr)2C7JnolQVWNfSAa$M@JcK(DZ_P zj3%24?$`LR+?qMJY5E6kMiH=8(;L_r4S0F-fEvqEOc!deVRC&sHffb_a$16q|R#5OUOxM(9w1&t> Jyk_K>1^|47oH_si delta 408 zcmZ3}%=Ms&Yr_v-773$6eVhOA-r;0frB!ip@*VL67Fl-1tBV~Z7Ri9*1TymqN=t%M zlS_+I!xD2!QyCZ-K;n}FCK*gG&|^%Q{9#uHFHcEPVqS4hVo7FxUh(9{Na4vAsUnj* zcGp16=h&m83^sQ9g={8?%>nmk_$b~>aycPX3^q3?wXig^C^aRdvLKZKApQdN%G9D2D zd5RmN2kZ?Hf4YMn;~z}7Pmj=N+yHj&b{+#ppQy MA!?SqX5^R#0B(?!mjD0& diff --git a/td/telegram/SecureManager.cpp b/td/telegram/SecureManager.cpp index 5ee34e4c8..30250f3de 100644 --- a/td/telegram/SecureManager.cpp +++ b/td/telegram/SecureManager.cpp @@ -682,10 +682,6 @@ class GetPassportAuthorizationForm : public NetQueryCallback { auto *file_manager = G()->td().get_actor_unsafe()->file_manager_.get(); std::vector values; - bool is_selfie_required = - (authorization_form_->flags_ & telegram_api::account_authorizationForm::SELFIE_REQUIRED_MASK) != 0; - bool is_translation_required = - (authorization_form_->flags_ & telegram_api::account_authorizationForm::TRANSLATION_REQUIRED_MASK) != 0; vector types; for (auto &type_ptr : authorization_form_->required_types_) { CHECK(type_ptr != nullptr); @@ -697,7 +693,8 @@ class GetPassportAuthorizationForm : public NetQueryCallback { } case telegram_api::secureRequiredTypeOneOf::ID: { auto type = move_tl_object_as(type_ptr); - append(types, get_secure_value_types(type->types_)); + // TODO + // append(types, get_secure_value_types(type->types_)); break; } default: @@ -820,8 +817,8 @@ class GetPassportAuthorizationForm : public NetQueryCallback { } promise_.set_value(make_tl_object( - authorization_form_id_, get_passport_element_types_object(types), std::move(values), std::move(errors), - is_selfie_required, is_translation_required, authorization_form_->privacy_policy_url_)); + authorization_form_id_, get_passport_element_types_object(types), std::move(values), std::move(errors), true, + true, authorization_form_->privacy_policy_url_)); stop(); } }; @@ -997,8 +994,7 @@ void SecureManager::get_passport_authorization_form(string password, UserId bot_ Promise promise) { refcnt_++; auto authorization_form_id = ++authorization_form_id_; - authorization_forms_[authorization_form_id] = - AuthorizationForm{bot_user_id, scope, public_key, payload, false, false, false}; + authorization_forms_[authorization_form_id] = AuthorizationForm{bot_user_id, scope, public_key, payload, false}; auto new_promise = PromiseCreator::lambda([actor_id = actor_id(this), authorization_form_id, promise = std::move(promise)]( Result r_authorization_form) mutable { @@ -1025,8 +1021,6 @@ void SecureManager::on_get_passport_authorization_form(int32 authorization_form_ auto authorization_form = r_authorization_form.move_as_ok(); CHECK(authorization_form != nullptr); - it->second.is_selfie_required = authorization_form->is_selfie_required_; - it->second.is_translation_required = authorization_form->is_translation_required_; promise.set_value(std::move(authorization_form)); } @@ -1097,8 +1091,7 @@ void SecureManager::do_send_passport_authorization_form(int32 authorization_form } auto r_encrypted_credentials = - get_encrypted_credentials(credentials, it->second.payload, it->second.is_selfie_required, - it->second.is_translation_required, it->second.public_key); + get_encrypted_credentials(credentials, it->second.payload, true, true, it->second.public_key); if (r_encrypted_credentials.is_error()) { return promise.set_error(r_encrypted_credentials.move_as_error()); } diff --git a/td/telegram/SecureManager.h b/td/telegram/SecureManager.h index a92ff4b85..7502e4629 100644 --- a/td/telegram/SecureManager.h +++ b/td/telegram/SecureManager.h @@ -56,8 +56,6 @@ class SecureManager : public NetQueryCallback { string scope; string public_key; string payload; - bool is_selfie_required; - bool is_translation_required; bool is_received; }; diff --git a/td/telegram/SecureValue.cpp b/td/telegram/SecureValue.cpp index 6896368cf..30eabe55f 100644 --- a/td/telegram/SecureValue.cpp +++ b/td/telegram/SecureValue.cpp @@ -510,7 +510,7 @@ EncryptedSecureValue get_encrypted_secure_value(FileManager *file_manager, if (secure_value->selfie_ != nullptr) { result.selfie = get_encrypted_secure_file(file_manager, std::move(secure_value->selfie_)); } - result.translations = get_encrypted_secure_files(file_manager, std::move(secure_value->translations_)); + result.translations = get_encrypted_secure_files(file_manager, std::move(secure_value->translation_)); result.hash = secure_value->hash_.as_slice().str(); if (!check_encrypted_secure_value(result)) { LOG(ERROR) << "Receive invalid encrypted secure value of type " << result.type; @@ -580,7 +580,7 @@ telegram_api::object_ptr get_input_secure_value_ CHECK(selfie); } if (!value.translations.empty()) { - flags |= telegram_api::inputSecureValue::TRANSLATIONS_MASK; + flags |= telegram_api::inputSecureValue::TRANSLATION_MASK; } return telegram_api::make_object( flags, get_input_secure_value_type(value.type), is_plain ? nullptr : get_secure_data_object(value.data),