Skip to content

Commit ea3b05a

Browse files
dbeltradirkz
authored andcommitted
adapting to alpine image
- time_t -> u64: see [1] - removing dynamic library as cdylib is unsupported (this is an update of 501cca6 so it can be merged) [1] rust-lang/libc#1848
1 parent f95d40f commit ea3b05a

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ build:
7070

7171
install: build
7272
mkdir -p $(LIB_DIR) $(PKGCONFIG_DIR)
73-
$(INSTALL) $(LIB_DYNAMIC_PATH) $(LIB_DIR)
7473
$(INSTALL) $(LIB_STATIC_PATH) $(LIB_DIR)
7574
$(INSTALL) $(PKGCONFIG_PATH) $(PKGCONFIG_DIR)
7675

src/lib.rs

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use libc::{
2323
c_char,
2424
c_uint,
2525
size_t,
26-
time_t,
2726
};
2827

2928
use chrono::LocalResult;
@@ -582,7 +581,7 @@ impl<'a> DecryptionHelper for &mut Helper<'a> {
582581
}
583582
let testy = &keyid.to_hex();
584583
trace!("Keystore::cert_find_ for {:?}", testy);
585-
584+
586585
trace!("Considering PKESK for {}", keyid);
587586

588587
// Collect the recipients. Note: we must return the
@@ -768,7 +767,7 @@ ffi!(fn pgp_get_key_ids(session: *mut Session,
768767
-> Result<()>
769768
{
770769
let session = Session::as_mut(session)?;
771-
770+
772771
let mm = session.mm();
773772

774773
let message: &[u8] = unsafe { check_slice!(ctext, csize) };
@@ -1260,10 +1259,10 @@ ffi!(fn pgp_encrypt_and_sign(session: *mut Session,
12601259
session, keylist, ptext, psize, ctextp, csizep, true)
12611260
});
12621261

1263-
// PEP_STATUS _pgp_generate_keypair(PEP_SESSION session, pEp_identity *identity, time_t when)
1262+
// PEP_STATUS _pgp_generate_keypair(PEP_SESSION session, pEp_identity *identity, i64 when)
12641263
ffi!(fn _pgp_generate_keypair(session: *mut Session,
12651264
identity: *mut PepIdentity,
1266-
when: time_t)
1265+
when: i64)
12671266
-> Result<()>
12681267
{
12691268
let session = Session::as_mut(session)?;
@@ -2078,10 +2077,10 @@ fn _pgp_key_expired(vc: &ValidCert) -> bool
20782077
}
20792078

20802079
// PEP_STATUS pgp_key_expired(PEP_SESSION session, const char *fpr,
2081-
// const time_t when, bool *expired)
2080+
// const i64 when, bool *expired)
20822081
ffi!(fn pgp_key_expired(session: *mut Session,
20832082
fpr: *const c_char,
2084-
when: time_t,
2083+
when: i64,
20852084
expiredp: *mut bool)
20862085
-> Result<()>
20872086
{
@@ -2299,10 +2298,10 @@ ffi!(fn pgp_get_key_rating(session: *mut Session, fpr: *const c_char,
22992298
Ok(())
23002299
});
23012300

2302-
// PEP_STATUS pgp_key_created(PEP_SESSION session, const char *fpr, time_t *created)
2301+
// PEP_STATUS pgp_key_created(PEP_SESSION session, const char *fpr, i64 *created)
23032302
ffi!(fn pgp_key_created(session: *mut Session,
23042303
fpr: *const c_char,
2305-
createdp: *mut time_t)
2304+
createdp: *mut i64)
23062305
-> Result<()>
23072306
{
23082307
let session = Session::as_mut(session)?;
@@ -2317,7 +2316,7 @@ ffi!(fn pgp_key_created(session: *mut Session,
23172316
UnknownError,
23182317
"Creation time out of range")?.as_secs();
23192318

2320-
*createdp = t as time_t;
2319+
*createdp = t as i64;
23212320

23222321
Ok(())
23232322
});
@@ -2496,28 +2495,28 @@ ZOeYHUIgxtJmOOp8ty/EfgEbx2QAAMDtAQC5fuVHyLfl1SqncTZaZkdaoSEqHdZA
24962495
// Version: 3
24972496
// Recipient: 003F542BE1540CD4
24982497
// Pk algo: ECDH
2499-
//
2498+
//
25002499
// Sym. Encrypted and Integrity Protected Data Packet, new CTB, 300 bytes
25012500
// │ Version: 1
25022501
// │ Session key: 09B40F05C8F12C7FF6F409698E2358C221654CDC7E300872686FEF1E16EF2385
25032502
// │ Symmetric algo: AES-256
25042503
// │ Decryption successful
2505-
// │
2504+
// │
25062505
// ├── Compressed Data Packet, new CTB, 256 bytes
25072506
// │ │ Algorithm: ZIP
2508-
// │ │
2507+
// │ │
25092508
// │ ├── One-Pass Signature Packet, new CTB, 13 bytes
25102509
// │ │ Version: 3
25112510
// │ │ Type: Binary
25122511
// │ │ Pk algo: EdDSA
25132512
// │ │ Hash algo: SHA512
25142513
// │ │ Issuer: D96F49BEF7FEB210
25152514
// │ │ Last: true
2516-
// │ │
2515+
// │ │
25172516
// │ ├── Literal Data Packet, new CTB, 14 bytes
25182517
// │ │ Format: Binary data
25192518
// │ │ Content: "hi, pep\n"
2520-
// │ │
2519+
// │ │
25212520
// │ └── Signature Packet, new CTB, 212 bytes
25222521
// │ Version: 4
25232522
// │ Type: Binary
@@ -2533,7 +2532,7 @@ ZOeYHUIgxtJmOOp8ty/EfgEbx2QAAMDtAQC5fuVHyLfl1SqncTZaZkdaoSEqHdZA
25332532
// │ Intended Recipient: 64E7981D4220C6D26638EA7CB72FC47E011BC764
25342533
// │ Digest prefix: 843B
25352534
// │ Level: 0 (signature over data)
2536-
// │
2535+
// │
25372536
// └── Modification Detection Code Packet, new CTB, 20 bytes
25382537
// Digest: 430056320490BE00DD9695E9DA5964207E54844B
25392538
// Computed digest: 430056320490BE00DD9695E9DA5964207E54844B
@@ -2896,7 +2895,7 @@ l/Z6+iUK0OopAbQ=
28962895

28972896
// let ptext = unsafe { check_slice!(plaintext, plaintext_len) };
28982897
// let s = String::from_utf8_lossy(ptext);
2899-
2898+
29002899
// println!("well: {} then", s);
29012900
//assert_eq!(ptext, MSG.as_bytes());
29022901

0 commit comments

Comments
 (0)