# [PATCH] openssl_pkcs7_encrypt to/from variable or file

- Thread: https://externals.io/message/5221
- Original archive: https://news-web.php.net/php.internals/5221
- Started by Richard Burton on 2003-11-05T15:59:09+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5221 — Richard Burton — 2003-11-05T15:59:09+00:00

URL: https://externals.io/message/5221#5221

Eric,

Might I suggest that if you submit a patch for this, you add just one 
function and check for a "file://" prefix to determine if the user want to 
work with a file or variable? This is the way certificates are handled at 
present, and I used this method for my patch to try and be consistent with 
it.

I'm a big fan of consistency, but I know others' views differ. I guess it's 
over to Wez for guidence, since it's his extension?

Richard.


>From: Eric COLINET <e.colinet@laposte.net>
>To: <internals@lists.php.net>
>CC: <wez@php.net>
>Subject: Re: [PHP-DEV] [PATCH] openssl_pkcs7_encrypt to/from variable  or 
>file
>Date: Wed, 05 Nov 2003 12:57:20 +0100
>
>Hi !
>
>In the same series ..
>
>I have no patch to provide but i've written two functions related to 
>php_openssl:
>         openssl_pubkey_export
>         openssl_pubkey_export_to_file
>
>That simply allow the export of public keys that seems to be not possible 
>before.
>
>I there is no special reason for that i can submit them (they are small 
>modification of openssl_pkey_export & openssl_pkey_export_to_file)
>
>
>Eric

_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection 
http://www.msn.co.uk/specials/btbroadband

---

## #5299 — Eric COLINET — 2003-11-06T16:19:20+00:00

URL: https://externals.io/message/5221#5299 · In reply to: #5221

Hi !

Richard,

I understand very well the benefit of using only one function to do the 
same work, but they are already 2 function that does the same for private 
keys and for consistency i think i had to submit 2 function to do the same 
job for public keys.
Of course the best way is to have only too function to do the job (one for 
public and one for private keys) but i just can't decide myself to break 
compatibility.

So i submit my two little functions. Sorry this is not a patch.

Regards,
Eric



At 16:59 05/11/2003, Richard Burton wrote:
>Eric,
>
>Might I suggest that if you submit a patch for this, you add just one 
>function and check for a "file://" prefix to determine if the user want to 
>work with a file or variable? This is the way certificates are handled at 
>present, and I used this method for my patch to try and be consistent with it.
>
>I'm a big fan of consistency, but I know others' views differ. I guess 
>it's over to Wez for guidence, since it's his extension?
>
>Richard.
>
>
> > […]
>
>_________________________________________________________________
>Tired of 56k? Get a FREE BT Broadband connection 
>http://www.msn.co.uk/specials/btbroadband

---

## #5300 — Richard Antony Burton — 2003-11-06T16:33:03+00:00

URL: https://externals.io/message/5221#5300 · In reply to: #5299

Eric,

Appologies, I should have been more careful to check I actually knew what I
was talking about before I opened my mouth ;-) Didn't realise the existing
private key version came in two separate functions like this. As I said, I'm
a big fan of consistency, but I guess we have two precedents here - so
either is good?

I have to follow the other method for my patch, since there are two
parameters to the function which could be either a variable or file,
otherwise we would need four versions of the function to cover all
combinations!

Richard.

----- Original Message ----- 
From: "Eric COLINET" <e.colinet@laposte.net>
To: "Richard Burton" <richardaburton@hotmail.com>; <internals@lists.php.net>
Sent: Thursday, November 06, 2003 4:19 PM
Subject: Re: [PHP-DEV] [PATCH] openssl_pkcs7_encrypt to/from variable or
file


> Hi !
>
> Richard,
>
> I understand very well the benefit of using only one function to do the
> same work, but they are already 2 function that does the same for private
> keys and for consistency i think i had to submit 2 function to do the same
> job for public keys.
> Of course the best way is to have only too function to do the job (one for
> public and one for private keys) but i just can't decide myself to break
> compatibility.

---

## #5311 — Eric COLINET — 2003-11-07T10:42:58+00:00

URL: https://externals.io/message/5221#5311 · In reply to: #5300

Hi !

It's a problem for sure...

Wez ?  what do you think about that ?



At 17:33 06/11/2003, Richard Antony Burton wrote:
>Eric,
>
>Appologies, I should have been more careful to check I actually knew what I
>was talking about before I opened my mouth ;-) Didn't realise the existing
>private key version came in two separate functions like this. As I said, I'm
>a big fan of consistency, but I guess we have two precedents here - so
>either is good?
>
>I have to follow the other method for my patch, since there are two
>parameters to the function which could be either a variable or file,
>otherwise we would need four versions of the function to cover all
>combinations!
>
>Richard.
>
>----- Original Message -----
>From: "Eric COLINET" <e.colinet@laposte.net>
>To: "Richard Burton" <richardaburton@hotmail.com>; <internals@lists.php.net>
>Sent: Thursday, November 06, 2003 4:19 PM
>Subject: Re: [PHP-DEV] [PATCH] openssl_pkcs7_encrypt to/from variable or
>file
>
>
> > […]

---

## #5312 — Wez Furlong — 2003-11-07T11:00:32+00:00

URL: https://externals.io/message/5221#5312 · In reply to: #5311

I'll review the patches etc. this weekend; I only just got back
to the office after being away for ~3 weeks and I need to catch up.

--Wez.

----- Original Message ----- 
From: "Eric COLINET" <e.colinet@laposte.net>
To: "Richard Antony Burton" <richardaburton@hotmail.com>
Cc: <internals@lists.php.net>
Sent: Friday, November 07, 2003 10:42 AM
Subject: Re: [PHP-DEV] [PATCH] openssl_pkcs7_encrypt to/from variable or
file


> Hi !
>
> It's a problem for sure...
>
> Wez ?  what do you think about that ?
