diff options
Diffstat (limited to 'bpkg/auth.hxx')
-rw-r--r-- | bpkg/auth.hxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/bpkg/auth.hxx b/bpkg/auth.hxx index f3a02a6..54e6884 100644 --- a/bpkg/auth.hxx +++ b/bpkg/auth.hxx @@ -1,5 +1,4 @@ // file : bpkg/auth.hxx -*- C++ -*- -// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef BPKG_AUTH_HXX @@ -16,20 +15,18 @@ namespace bpkg { // Authenticate a repository certificate. If the configuration directory is - // NULL, then perform without a certificate database. If it is empty, then - // check if the current working directory is a configuration. If it is, then - // use its certificate database. Otherwise, continue as if it was NULL. All - // other values (including '.') are assumed to be valid configuration paths - // and will be diagnosed if that's not the case. + // NULL, then perform without a certificate database. Otherwise, use its + // certificate database. // // If the dependent trust fingerprint is present then try to authenticate // the certificate for use by the dependent prior to prompting the user. // Note that if certificate is authenticated for such a use, then it is not // persisted into the database. // - // If the configuration is used, then check if we are already in transaction. - // If so, then assume the configuration database is already opened and use - // that. Otherwise, open the database and start a new transaction. + // If the configuration is used and also the configuration database is + // specified, then assume the database is already opened with the + // transaction started and use that. Otherwise, open the database and start + // a new transaction. // // Note that one drawback of doing this as part of an existing transaction // is that if things go south and the transaction gets aborted, then all the @@ -39,6 +36,7 @@ namespace bpkg shared_ptr<const certificate> authenticate_certificate (const common_options&, const dir_path* configuration, + database*, const optional<string>& cert_pem, const repository_location&, const optional<string>& dependent_trust); @@ -81,15 +79,11 @@ namespace bpkg // openssl x509 -noout -modulus -in cert.pem // openssl rsa -noout -modulus -in key.pem // - // But taking into account that we need to be able to use custom engines to - // access keys, it seems to be impossible to provide the same additional - // openssl options to fit both the rsa and pkeyutl commands. The first would - // require "-engine pkcs11 -inform engine", while the second -- "-engine - // pkcs11 -keyform engine". Also it would require to enter the key password - // again, which is a showstopper. Maybe the easiest would be to recover the - // sum back from the signature using the certificate, and compare it with - // the original sum (like we do in authenticate_repository()). But that - // would require to temporarily save the certificate to file. + // However, it would require to enter the key password again, which is a + // showstopper. Maybe the easiest would be to recover the sum back from the + // signature using the certificate, and compare it with the original sum + // (like we do in authenticate_repository()). But that would require to + // temporarily save the certificate to file. // std::vector<char> sign_repository (const common_options&, |