Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
576ac4b8
Commit
576ac4b8
authored
19 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix initialization bug in pgcrypto openssl code. Marko Kreen
parent
7e33fae3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/pgcrypto/expected/3des.out
+4
-4
4 additions, 4 deletions
contrib/pgcrypto/expected/3des.out
contrib/pgcrypto/openssl.c
+2
-2
2 additions, 2 deletions
contrib/pgcrypto/openssl.c
contrib/pgcrypto/sql/3des.sql
+1
-1
1 addition, 1 deletion
contrib/pgcrypto/sql/3des.sql
with
7 additions
and
7 deletions
contrib/pgcrypto/expected/3des.out
+
4
−
4
View file @
576ac4b8
...
@@ -17,14 +17,14 @@ decode('01 01 01 01 01 01 01 01
...
@@ -17,14 +17,14 @@ decode('01 01 01 01 01 01 01 01
select encode( encrypt('', 'foo', '3des'), 'hex');
select encode( encrypt('', 'foo', '3des'), 'hex');
encode
encode
------------------
------------------
9b641a6936249eb4
752111e37a2d7ac3
(1 row)
(1 row)
-- 10 bytes key
-- 10 bytes key
select encode( encrypt('foo', '0123456789', '3des'), 'hex');
select encode( encrypt('foo', '0123456789', '3des'), 'hex');
encode
encode
------------------
------------------
6f02b7076a366504
d2fb8baa1717cb02
(1 row)
(1 row)
-- 22 bytes key
-- 22 bytes key
...
@@ -45,10 +45,10 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
...
@@ -45,10 +45,10 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
select encode(encrypt_iv('foo', '0123456', 'abcd', '3des'), 'hex');
select encode(encrypt_iv('foo', '0123456', 'abcd', '3des'), 'hex');
encode
encode
------------------
------------------
df27c264fb24ed7a
50735067b073bb93
(1 row)
(1 row)
select decrypt_iv(decode('
df27c264fb24ed7a
', 'hex'), '0123456', 'abcd', '3des');
select decrypt_iv(decode('
50735067b073bb93
', 'hex'), '0123456', 'abcd', '3des');
decrypt_iv
decrypt_iv
------------
------------
foo
foo
...
...
This diff is collapsed.
Click to expand it.
contrib/pgcrypto/openssl.c
+
2
−
2
View file @
576ac4b8
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.
19
2005/07/0
4 02:02:01 momjian
Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.
20
2005/07/0
5 18:15:36 tgl
Exp $
*/
*/
#include
<postgres.h>
#include
<postgres.h>
...
@@ -393,7 +393,7 @@ ossl_des3_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
...
@@ -393,7 +393,7 @@ ossl_des3_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
memset
(
&
xkey1
,
0
,
sizeof
(
xkey1
));
memset
(
&
xkey1
,
0
,
sizeof
(
xkey1
));
memset
(
&
xkey2
,
0
,
sizeof
(
xkey2
));
memset
(
&
xkey2
,
0
,
sizeof
(
xkey2
));
memset
(
&
xkey
2
,
0
,
sizeof
(
xkey
2
));
memset
(
&
xkey
3
,
0
,
sizeof
(
xkey
3
));
memcpy
(
&
xkey1
,
key
,
klen
>
8
?
8
:
klen
);
memcpy
(
&
xkey1
,
key
,
klen
>
8
?
8
:
klen
);
if
(
klen
>
8
)
if
(
klen
>
8
)
memcpy
(
&
xkey2
,
key
+
8
,
(
klen
-
8
)
>
8
?
8
:
(
klen
-
8
));
memcpy
(
&
xkey2
,
key
+
8
,
(
klen
-
8
)
>
8
?
8
:
(
klen
-
8
));
...
...
This diff is collapsed.
Click to expand it.
contrib/pgcrypto/sql/3des.sql
+
1
−
1
View file @
576ac4b8
...
@@ -22,5 +22,5 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
...
@@ -22,5 +22,5 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
-- iv
-- iv
select
encode
(
encrypt_iv
(
'foo'
,
'0123456'
,
'abcd'
,
'3des'
),
'hex'
);
select
encode
(
encrypt_iv
(
'foo'
,
'0123456'
,
'abcd'
,
'3des'
),
'hex'
);
select
decrypt_iv
(
decode
(
'
df27c264fb24ed7a
'
,
'hex'
),
'0123456'
,
'abcd'
,
'3des'
);
select
decrypt_iv
(
decode
(
'
50735067b073bb93
'
,
'hex'
),
'0123456'
,
'abcd'
,
'3des'
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment