From c3deb5d325b7e327e14bdead1fb03de5ba42644a Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Tue, 3 May 2022 23:11:25 +0200 Subject: ox: dont require marginal trust level Maybe we can make this configurable later. So users have the freedom to be more strict. This commit partly reverts 62018f48c5f1a0410445fce5bca5fdd6a9e4d907. Example to edit trust level: ``` gpg --edit-key somekeyid gpg (GnuPG) 2.3.4; Copyright (C) 2021 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. pub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: SC trust: unknown validity: full sub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: E [ full ] (1). xmpp:user@domain.de gpg> trust pub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: SC trust: unknown validity: full sub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: E [ full ] (1). xmpp:user@domain.de Please decide how far you trust this user to correctly verify other users' keys (by looking at passports, checking fingerprints from different sources, etc.) 1 = I don't know or won't say 2 = I do NOT trust 3 = I trust marginally 4 = I trust fully 5 = I trust ultimately m = back to the main menu Your decision? 3 pub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: SC trust: marginal validity: full sub rsa4096/keyid created: 2020-06-26 expires: 2022-06-26 usage: E [ full ] (1). xmpp:user@domain.de Please note that the shown key validity is not necessarily correct unless you restart the program. gpg> quit ``` --- src/pgp/gpg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pgp/gpg.c b/src/pgp/gpg.c index 25704847..bdb00408 100644 --- a/src/pgp/gpg.c +++ b/src/pgp/gpg.c @@ -1114,10 +1114,15 @@ _ox_key_is_usable(gpgme_key_t key, const char* const barejid, gboolean secret) result = FALSE; } + // This might be a nice features but AFAIK is not defined in the XEP. + // If we add this we need to expand our documentation on how to set the + // trust leven in gpg. I'll add an example to this commit body. + /* if (key->owner_trust < GPGME_VALIDITY_MARGINAL) { log_info("OX: Owner trust of %s's key is < GPGME_VALIDITY_MARGINAL", barejid); result = FALSE; } + */ return result; } -- cgit 1.4.1-2-gfad0 : root/subx/037heap.cc
blob: 315fd0d58f00869f01ae9167686a3acbfa54cafb (plain) (tree)




























                                                                             
//: Support for dynamic allocation.
//:
//: Just provide a special label marking the first unused address in the data
//: segment. Then we'll write SubX helpers to make use of it.

:(before "Begin rewrite_global_variables")
insert_heap_global_variable(p);
:(code)
void insert_heap_global_variable(program& p) {
  if (SIZE(p.segments) < 2)
    return;  // no data segment defined
  // Start-of-heap:
  p.segments.at(1).lines.push_back(label("Start-of-heap"));
}

line label(string s) {
  line result;
  result.words.push_back(word());
  result.words.back().data = (s+":");
  return result;
}

line imm32(const string& s) {
  line result;
  result.words.push_back(word());
  result.words.back().data = s;
  result.words.back().metadata.push_back("imm32");
  return result;
}