Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
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
pikelang
pike
Commits
3782f452
Commit
3782f452
authored
26 years ago
by
Niels Möller
Browse files
Options
Downloads
Patches
Plain Diff
Updated for pike-0.6.
Rev: src/modules/_Crypto/cbc.c:1.12
parent
5ff7aa94
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/_Crypto/cbc.c
+25
-8
25 additions, 8 deletions
src/modules/_Crypto/cbc.c
with
25 additions
and
8 deletions
src/modules/_Crypto/cbc.c
+
25
−
8
View file @
3782f452
/*
/*
* $Id: cbc.c,v 1.1
1
1998/0
4
/2
0
1
8:53:54 grubba
Exp $
* $Id: cbc.c,v 1.1
2
1998/0
8
/2
6
1
6:33:48 nisse
Exp $
*
*
* CBC (Cipher Block Chaining Mode) crypto module for Pike.
* CBC (Cipher Block Chaining Mode) crypto module for Pike.
*
*
...
@@ -124,18 +124,35 @@ static void f_create(INT32 args)
...
@@ -124,18 +124,35 @@ static void f_create(INT32 args)
if
(
args
<
1
)
{
if
(
args
<
1
)
{
error
(
"Too few arguments to cbc->create()
\n
"
);
error
(
"Too few arguments to cbc->create()
\n
"
);
}
}
if
((
sp
[
-
args
].
type
!=
T_PROGRAM
)
&&
#if 0
(
sp
[
-
args
].
type
!=
T_OBJECT
))
{
fprintf(stderr, "cbc->create: type = %d\n",
error
(
"Bad argument 1 to cbc->create()
\n
"
);
sp[-args].type);
}
#endif
if
(
sp
[
-
args
].
type
==
T_PROGRAM
)
{
switch
(
sp
[
-
args
].
type
)
{
case
T_PROGRAM
:
/* FIXME: Is this type obsoleted? */
THIS
->
object
=
clone_object
(
sp
[
-
args
].
u
.
program
,
args
-
1
);
THIS
->
object
=
clone_object
(
sp
[
-
args
].
u
.
program
,
args
-
1
);
}
else
{
break
;
case
T_FUNCTION
:
apply_svalue
(
sp
-
args
,
args
-
1
);
/* Check return value */
if
(
sp
[
-
1
].
type
!=
T_OBJECT
)
error
(
"cbc->create(): Returned value is not an object
\n
"
);
add_ref
(
THIS
->
object
=
sp
[
-
1
].
u
.
object
);
break
;
case
T_OBJECT
:
if
(
args
!=
1
)
{
if
(
args
!=
1
)
{
error
(
"Too many arguments to cbc->create()
\n
"
);
error
(
"Too many arguments to cbc->create()
\n
"
);
}
}
add_ref
(
THIS
->
object
=
sp
[
-
args
].
u
.
object
);
add_ref
(
THIS
->
object
=
sp
[
-
1
].
u
.
object
);
break
;
default:
error
(
"Bad argument 1 to cbc->create()
\n
"
);
}
}
pop_stack
();
/* Just one element left on the stack in both cases */
pop_stack
();
/* Just one element left on the stack in both cases */
assert_is_crypto_module
(
THIS
->
object
);
assert_is_crypto_module
(
THIS
->
object
);
...
...
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