Update layer 85.

GitOrigin-RevId: 65fb62fea07f05637b2b652f09a4a6be2de3346b
This commit is contained in:
levlam 2018-08-10 22:21:03 +03:00
parent d3bce1b23d
commit c1c1308ba8
5 changed files with 14 additions and 23 deletions

View File

@ -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<SecureFile> files:flags.4?Vector<SecureFile> 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<SecureFile> files:flags.4?Vector<SecureFile> 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<InputSecureFile> files:flags.4?Vector<InputSecureFile> 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<InputSecureFile> files:flags.4?Vector<InputSecureFile> 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<bytes> 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<bytes> text:string = SecureValueError;
secureValueErrorTranslations#781e629b type:SecureValueType file_hash:Vector<bytes> 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<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> privacy_policy_url:flags.0?string = account.AuthorizationForm;
account.authorizationForm#ad2e1cd8 flags:# required_types:Vector<SecureRequiredType> values:Vector<SecureValue> errors:Vector<SecureValueError> users:Vector<User> 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<SecureValueType> = 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> = SecureRequiredType;
---functions---

Binary file not shown.

View File

@ -682,10 +682,6 @@ class GetPassportAuthorizationForm : public NetQueryCallback {
auto *file_manager = G()->td().get_actor_unsafe()->file_manager_.get();
std::vector<TdApiSecureValue> 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<SecureValueType> 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<telegram_api::secureRequiredTypeOneOf>(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<td_api::passportAuthorizationForm>(
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<TdApiAuthorizationForm> 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<TdApiAuthorizationForm> 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());
}

View File

@ -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;
};

View File

@ -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<telegram_api::inputSecureValue> 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<telegram_api::inputSecureValue>(
flags, get_input_secure_value_type(value.type), is_plain ? nullptr : get_secure_data_object(value.data),