Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
576ac4b8
Commit
576ac4b8
authored
Jul 05, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix initialization bug in pgcrypto openssl code. Marko Kreen
parent
7e33fae3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
contrib/pgcrypto/expected/3des.out
contrib/pgcrypto/expected/3des.out
+4
-4
contrib/pgcrypto/openssl.c
contrib/pgcrypto/openssl.c
+2
-2
contrib/pgcrypto/sql/3des.sql
contrib/pgcrypto/sql/3des.sql
+1
-1
No files found.
contrib/pgcrypto/expected/3des.out
View file @
576ac4b8
...
...
@@ -17,14 +17,14 @@ decode('01 01 01 01 01 01 01 01
select encode( encrypt('', 'foo', '3des'), 'hex');
encode
------------------
9b641a6936249eb4
752111e37a2d7ac3
(1 row)
-- 10 bytes key
select encode( encrypt('foo', '0123456789', '3des'), 'hex');
encode
------------------
6f02b7076a366504
d2fb8baa1717cb02
(1 row)
-- 22 bytes key
...
...
@@ -45,10 +45,10 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
select encode(encrypt_iv('foo', '0123456', 'abcd', '3des'), 'hex');
encode
------------------
df27c264fb24ed7a
50735067b073bb93
(1 row)
select decrypt_iv(decode('
df27c264fb24ed7a
', 'hex'), '0123456', 'abcd', '3des');
select decrypt_iv(decode('
50735067b073bb93
', 'hex'), '0123456', 'abcd', '3des');
decrypt_iv
------------
foo
...
...
contrib/pgcrypto/openssl.c
View file @
576ac4b8
...
...
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.
19 2005/07/04 02:02:01 momjian
Exp $
* $PostgreSQL: pgsql/contrib/pgcrypto/openssl.c,v 1.
20 2005/07/05 18:15:36 tgl
Exp $
*/
#include <postgres.h>
...
...
@@ -393,7 +393,7 @@ ossl_des3_init(PX_Cipher * c, const uint8 *key, unsigned klen, const uint8 *iv)
memset
(
&
xkey1
,
0
,
sizeof
(
xkey1
));
memset
(
&
xkey2
,
0
,
sizeof
(
xkey2
));
memset
(
&
xkey
2
,
0
,
sizeof
(
xkey2
));
memset
(
&
xkey
3
,
0
,
sizeof
(
xkey3
));
memcpy
(
&
xkey1
,
key
,
klen
>
8
?
8
:
klen
);
if
(
klen
>
8
)
memcpy
(
&
xkey2
,
key
+
8
,
(
klen
-
8
)
>
8
?
8
:
(
klen
-
8
));
...
...
contrib/pgcrypto/sql/3des.sql
View file @
576ac4b8
...
...
@@ -22,5 +22,5 @@ select decrypt(encrypt('foo', '0123456', '3des'), '0123456', '3des');
-- iv
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'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment