Skip to content

Commit

Permalink
Save implementation notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrsweet committed Jul 1, 2023
1 parent 4126c13 commit 7d0775b
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions cups/smime.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
#include "cups-private.h"
#include "smime.h"
#ifdef HAVE_OPENSSL
# include <openssl/ecdsa.h>
# include <openssl/evp.h>
# include <openssl/rsa.h>
#else
# include <openssl/crypto.h>
# include <openssl/err.h>
# include <openssl/pem.h>
# include <openssl/x509_vfy.h>
# include <openssl/x509v3.h>
#else // HAVE_GNUTLS
# include <gnutls/gnutls.h>
# include <gnutls/abstract.h>
# include <gnutls/crypto.h>
Expand Down Expand Up @@ -62,6 +64,25 @@ cupsSMIMEOpen(
(void)key;
(void)password;


#ifdef HAVE_OPENSSL

// Encrypt/write path:
//
// - Create STACK_OF(X509) *certs for credentials
// - bio for file IO, or HTTP BIO
// - Can't use PKCS7_de/encrypt since it doesn't support streaming
// - EVP_CIPHER_CTX_new to create a nw
// - EVP_CIPHER * is EVP_aes_256_gcm() for writing, EVP_aes_128/256_cbc/gcm() for reading
// - EVP_De/EncryptInit to start de/encryption
// - EVP_De/EncryptUpdate to de/encrypt a buffer
// - EVP_De/EncryptFinal to finish de/encryption
// -
// -

#else // HAVE_GNUTLS
#endif // HAVE_OPENSSL

return (NULL);
}

Expand Down

0 comments on commit 7d0775b

Please sign in to comment.